Skip to content

Web Streams: reject pending reads when releasing reader #41506

Description

@MattiasBuelens

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

Activity

  1. changed the title [-]Streams: reject pending reads when releasing reader[/-] [+]Web Streams: reject pending reads when releasing reader[/+] on Jan 13, 2022
  2. ronag commented on Jan 14, 2022

    @ronag
    Member
  3. essential-existence commented on Feb 4, 2022

    @essential-existence

    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

  4. MattiasBuelens commented on Feb 4, 2022

    @MattiasBuelens
    ContributorAuthor

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

  5. jasnell commented on Feb 4, 2022

    @jasnell
    Member

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

  6. essential-existence commented on Feb 5, 2022

    @essential-existence

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

  7. moved this to Pending Triage in Node.js feature requestson Apr 4, 2022
  8. github-actions commented on Aug 5, 2022

    @github-actions
    Contributor

    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.

  9. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Aug 5, 2022
  10. jasnell commented on Aug 5, 2022

    @jasnell
    Member

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

  11. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Aug 6, 2022
  12. github-actions commented on Feb 2, 2023

    @github-actions
    Contributor

    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.

  13. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Feb 2, 2023
  14. MattiasBuelens commented on Feb 2, 2023

    @MattiasBuelens
    ContributorAuthor

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

  15. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Feb 3, 2023
  16. moved this from Awaiting Triage to Done in Node.js feature requestson Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.web streamsIssues and PRs related to the Web Streams API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions