[whatwg/streams] Discard auto-allocated BYOB request on enqueue (#1171)

As discovered in [#1170 (comment)](https://github.com/whatwg/streams/issues/1170#issuecomment-933822324): if a BYOB request was auto-allocated, but then you call `controller.enqueue()` instead of `byobRequest.respond()`, then the auto-allocated pull-into descriptor stays in the queue. If you later on switch from a default reader to a BYOB reader, you run into trouble because the list of read-into requests no longer matches up with the list of pending pull-into descriptors.

This PR fixes it by making `enqueue()` discard that auto-allocated BYOB request.

- [ ] At least two implementers are interested (and none opposed):
   * …
   * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * …
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: …
   * Firefox: …
   * Safari: …

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/1171


-- Commit Summary --

  * <a href="https://github.com/whatwg/streams/pull/1171/commits/dd4e75f897984342f48d1bc33451e8a464cf58c2">Discard auto-allocated BYOB request on enqueue()</a>
  * <a href="https://github.com/whatwg/streams/pull/1171/commits/d0b7ae50a1844f778cbc749caf39ad2de563b93e">Roll WPT</a>

-- File Changes --

    M index.bs (7)
    M reference-implementation/lib/abstract-ops/readable-streams.js (5)
    M reference-implementation/web-platform-tests (2)

-- Patch Links --

https://github.com/whatwg/streams/pull/1171.patch

https://github.com/whatwg/streams/pull/1171.diff


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1171

Received on Wednesday, 6 October 2021 03:24:33 UTC