node
node copied to clipboard
Web Streams: reject pending reads when releasing reader
Previously, calling ReadableStreamDefaultReader.releaseLock()
or ReadableStreamBYOBReader.releaseLock()
while there are pending read()
requests would throw a TypeError
.
The specification has been changed to allow this case, and to reject such pending read()
requests instead.
Standard change: https://github.com/whatwg/streams/pull/1168 Tests: https://github.com/web-platform-tests/wpt/pull/32072
@jasnell
Hello. Every time I run reader.releaseLock()
, an error is generated at any time, even on a newly created stream
TypeError [ERR_INVALID_STATE]: Invalid state: Reader released
@essential-existence I suggest you open a separate issue for that. This issue is about implementing a change to releaseLock()
.
That said, I am a bit curious. That error appears as the rejection reason for reader.closed
, but that promise is always marked as handled so it shouldn't cause an unhandled rejection. Unless your code is doing something else with reader.closed
, perhaps? I recommend you add some example code when opening a new issue. 😉
Great to see this change landed in the spec! Definitely will be nice to get this behavior implemented.
@essential-existence I suggest you open a separate issue for that. This issue is about implementing a change to
releaseLock()
.That said, I am a bit curious. That error appears as the rejection reason for
reader.closed
, but that promise is always marked as handled so it shouldn't cause an unhandled rejection. Unless your code is doing something else withreader.closed
, perhaps? I recommend you add some example code when opening a new issue. 😉
Yes, indeed, without affecting closed
no error is generated. I opened an issue.
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
Thank you auto-close bot bit I think this one needs to stay open for a bit still (unless it has already been resolved?)
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
@jasnell Looks like this was already fixed in #44292. 🙂