Skip to content

stream: apply multiple stream/iter fixes - #65652

Open
jasnell wants to merge 10 commits into
nodejs:mainfrom
jasnell:jasnell/stream-iter-fixes
Open

stream: apply multiple stream/iter fixes#65652
jasnell wants to merge 10 commits into
nodejs:mainfrom
jasnell:jasnell/stream-iter-fixes

Conversation

@jasnell

@jasnell jasnell commented Aug 30, 2026

Copy link
Copy Markdown
Member

Nine commits, nine issues:

  1. pull() cancellation cannot preempt a pending next()
  2. transformed push, broadcast, and share consumers leak their underlying side
  3. terminating a push consumer can make writer.end() hang forever
  4. byte-budget accounting is derived from mutable data
  5. writev() can resolve after losing the entire outer write
  6. DuplexChannel close() does not close an unread incoming direction
  7. merge() mishandles arbitrary errors and can block error propagation forever
  8. Share cancellation cannot interrupt the pull owner
  9. pipeToSync() starts asynchronous close work that nobody can observe

Recommend reviewing each commit separately.

Plus one minor cleanup commit.

Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
Signed-off-by: James M Snell <jasnell@gmail.com>
Assisted-by: Opencode
@jasnell
jasnell requested review from mcollina, ronag and trivikr August 30, 2026 00:58
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Aug 30, 2026
Signed-off-by: James M Snell <jasnell@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.74147% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.05%. Comparing base (045ff95) to head (23b211e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/broadcast.js 80.28% 14 Missing ⚠️
lib/internal/streams/iter/push.js 84.70% 10 Missing and 3 partials ⚠️
lib/internal/streams/iter/pull.js 95.15% 8 Missing ⚠️
lib/internal/streams/iter/share.js 91.78% 6 Missing ⚠️
lib/internal/streams/iter/consumers.js 93.54% 4 Missing ⚠️
lib/internal/streams/iter/duplex.js 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65652      +/-   ##
==========================================
- Coverage   91.79%   90.05%   -1.75%     
==========================================
  Files         402      754     +352     
  Lines      181164   255981   +74817     
  Branches    27776    48374   +20598     
==========================================
+ Hits       166308   230519   +64211     
- Misses      14517    16574    +2057     
- Partials      339     8888    +8549     
Files with missing lines Coverage Δ
lib/internal/streams/iter/utils.js 99.11% <100.00%> (+0.87%) ⬆️
lib/internal/streams/iter/duplex.js 97.27% <97.14%> (+0.92%) ⬆️
lib/internal/streams/iter/consumers.js 95.44% <93.54%> (-1.19%) ⬇️
lib/internal/streams/iter/share.js 87.38% <91.78%> (+0.96%) ⬆️
lib/internal/streams/iter/pull.js 83.96% <95.15%> (+0.61%) ⬆️
lib/internal/streams/iter/push.js 91.19% <84.70%> (-0.28%) ⬇️
lib/internal/streams/iter/broadcast.js 88.56% <80.28%> (+0.12%) ⬆️

... and 484 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.

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

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants