Skip to content

stream: fix stale byte stream queue size - #67499

Open
MattiasBuelens wants to merge 1 commit into
nodejs:mainfrom
MattiasBuelens:webstreams-byte-enqueue-stale-queue-size
Open

MattiasBuelens wants to merge 1 commit into
nodejs:mainfrom
MattiasBuelens:webstreams-byte-enqueue-stale-queue-size

Conversation

@MattiasBuelens

@MattiasBuelens MattiasBuelens commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Re-read the byte controller's queue size before filling each pending read request. A released BYOB reader can leave a partially filled pull-into descriptor that is enqueued while a default reader has multiple pending reads. Caching the queue size causes the loop to dequeue from an empty queue after fulfilling the first read request, which triggers an internal assertion error.

Add a regression test for one, two, and three pending reads and verify that any remaining queued bytes are preserved. (I'll also upstream this test to Web Platform Tests.)

Disclosure: code generated by AI (6.1 Sol via Codex), reviewed by me.

@MattiasBuelens MattiasBuelens added the web streams Issues and PRs related to the Web Streams API. label Nov 15, 2026
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 15, 2026
Re-read the byte controller's queue size before filling each pending
read request. A released BYOB reader can leave a partially filled
pull-into descriptor that is enqueued while a default reader has
multiple pending reads. Caching the queue size causes the loop to
dequeue from an empty queue after fulfilling the first read request.

Add a regression test for one, two, and three pending reads and verify
that any remaining queued bytes are preserved.

Signed-off-by: Mattias Buelens <mattias@buelens.com>
@MattiasBuelens
MattiasBuelens force-pushed the webstreams-byte-enqueue-stale-queue-size branch from 496e1e8 to 01f4238 Compare November 15, 2026 20:13
@MattiasBuelens MattiasBuelens added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 15, 2026
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.66%. Comparing base (537a20c) to head (01f4238).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67499   +/-   ##
=======================================
  Coverage   90.66%   90.66%           
=======================================
  Files         799      799           
  Lines      280254   280243   -11     
  Branches    54122    54116    -6     
=======================================
- Hits       254091   254083    -8     
- Misses      16280    16281    +1     
+ Partials     9883     9879    -4     
Files with missing lines Coverage Δ
lib/internal/webstreams/readablestream.js 98.43% <100.00%> (+0.07%) ⬆️

... and 27 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 15, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. web streams Issues and PRs related to the Web Streams API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants