Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Streams: reject pending reads when releasing reader #41506

Closed
MattiasBuelens opened this issue Jan 13, 2022 · 9 comments
Closed

Web Streams: reject pending reads when releasing reader #41506

MattiasBuelens opened this issue Jan 13, 2022 · 9 comments
Labels
feature request Issues that request new features to be added to Node.js. web streams

Comments

@MattiasBuelens
Copy link
Contributor

MattiasBuelens commented Jan 13, 2022

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: whatwg/streams#1168
Tests: web-platform-tests/wpt#32072

@MattiasBuelens MattiasBuelens added the feature request Issues that request new features to be added to Node.js. label Jan 13, 2022
@MattiasBuelens MattiasBuelens changed the title Streams: reject pending reads when releasing reader Web Streams: reject pending reads when releasing reader Jan 13, 2022
@ronag
Copy link
Member

ronag commented Jan 14, 2022

@jasnell

@essential-existence
Copy link

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

@MattiasBuelens
Copy link
Contributor Author

@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. 😉

@jasnell
Copy link
Member

jasnell commented Feb 4, 2022

Great to see this change landed in the spec! Definitely will be nice to get this behavior implemented.

@essential-existence
Copy link

@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. 😉

Yes, indeed, without affecting closed no error is generated. I opened an issue.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2022

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.

@github-actions github-actions bot added the stale label Aug 5, 2022
@jasnell
Copy link
Member

jasnell commented Aug 5, 2022

Thank you auto-close bot bit I think this one needs to stay open for a bit still (unless it has already been resolved?)

@github-actions github-actions bot removed the stale label Aug 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

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.

@github-actions github-actions bot added the stale label Feb 2, 2023
@MattiasBuelens
Copy link
Contributor Author

@jasnell Looks like this was already fixed in #44292. 🙂

@github-actions github-actions bot removed the stale label Feb 3, 2023
@jasnell jasnell closed this as completed Feb 4, 2023
@avivkeller avivkeller moved this from Awaiting Triage to Done in Node.js feature requests Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. web streams
Projects
None yet
Development

No branches or pull requests

5 participants