[whatwg/streams] Fix `respond()` leaving bytes queued behind a pending `read()` (PR #1393)

`ReadableByteStreamControllerRespondInReadableState()` moves the bytes written into a detached pull-into descriptor to the queue, and then fills any pending pull-into descriptors from it. However, we also need to fill any pending `read()` requests, since a default reader doesn't have a pull-into descriptor when there's no `autoAllocateChunkSize`. This left the `read()` pending forever, even though the stream *does* have bytes for it in its queue.

Fix it by also processing the read requests in this scenario, after processing the pull-into descriptors (so with `autoAllocateChunkSize`, the queued bytes still go into the buffer allocated for that `read()`).

Fixes #1390.

- [ ] At least two implementers are interested (and none opposed):
   * …
   * …
- [x] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://github.com/web-platform-tests/wpt/pull/64195
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: …
   * Gecko: …
   * WebKit: …
   * Deno: …
   * Node.js: …
- [ ] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: …
- [x] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

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


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/streams/1393.html" title="Last updated on Oct 25, 2026, 4:07 PM UTC (dda2951)">Preview</a> | <a href="https://whatpr.org/streams/1393/312b67e...dda2951.html" title="Last updated on Oct 25, 2026, 4:07 PM UTC (dda2951)">Diff</a>
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Fix respond() leaving bytes queued behind a pending read()

-- File Changes --

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

-- Patch Links --

https://github.com/whatwg/streams/pull/1393.patch
https://github.com/whatwg/streams/pull/1393.diff

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

Message ID: <whatwg/streams/pull/1393@github.com>

Received on Sunday, 25 October 2026 16:07:52 UTC