FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

stream: preserve falsy cancellation reasons by trivikr · Pull Request #64705 · nodejs/node · GitHub

/ node Public

stream: preserve falsy cancellation reasons - #64705

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-broadcast-share-falsy-cancellation
Aug 14, 2026
Merged

stream: preserve falsy cancellation reasons#64705
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-broadcast-share-falsy-cancellation

Conversation

trivikr commented Jul 24, 2026

Copy link
Copy Markdown
Member

Fixes: #64704

Previously, falsy reasons such as 0, '', false, and null were stored
but later treated as if no error existed. Consumers that had not started
waiting would therefore observe clean completion instead of the supplied
cancellation reason. Sync share also checked whether a consumer was detached
before surfacing its stored cancellation error.

This change uses undefined as the no-error sentinel and checks cancellation
reasons explicitly. Sync share now surfaces the reason before handling the
detached state.


Assisted-by: codex:gpt-5.6-sol

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Jul 24, 2026
trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 24, 2026

codecov Bot commented Jul 24, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.32%. Comparing base (bfa3e98) to head (0f06c0f).
⚠️ Report is 44 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/share.js 85.71% 2 Missing ⚠️
lib/internal/streams/iter/broadcast.js 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64705   +/-   ##
=======================================
  Coverage   90.32%   90.32%           
=======================================
  Files         760      760           
  Lines      249130   249134    +4     
  Branches    47041    47050    +9     
=======================================
+ Hits       225030   225039    +9     
+ Misses      15490    15487    -3     
+ Partials     8610     8608    -2     
Files with missing lines Coverage Δ
lib/internal/streams/iter/broadcast.js 87.81% <83.33%> (+0.02%) ⬆️
lib/internal/streams/iter/share.js 85.47% <85.71%> (+0.16%) ⬆️

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

Use undefined as the no-error sentinel when cancelling broadcast and
share consumers. This ensures that 0, an empty string, false, and null
are propagated instead of being converted to clean completion.

Make sync share surface cancellation reasons before handling detached
consumers, and add regression coverage for async and sync consumers.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
trivikr force-pushed the stream-iter-broadcast-share-falsy-cancellation branch from bf47906 to 0f06c0f Compare August 12, 2026 15:48
jasnell removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 14, 2026

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

trivikr added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2026
nodejs-github-bot merged commit bc813a7 into nodejs:main Aug 14, 2026
68 checks passed

Copy link
Copy Markdown
Collaborator

Landed in bc813a7

nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 14, 2026
trivikr deleted the stream-iter-broadcast-share-falsy-cancellation branch August 16, 2026 16:01
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Use undefined as the no-error sentinel when cancelling broadcast and
share consumers. This ensures that 0, an empty string, false, and null
are propagated instead of being converted to clean completion.

Make sync share surface cancellation reasons before handling detached
consumers, and add regression coverage for async and sync consumers.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #64705
Fixes: #64704
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Use undefined as the no-error sentinel when cancelling broadcast and
share consumers. This ensures that 0, an empty string, false, and null
are propagated instead of being converted to clean completion.

Make sync share surface cancellation reasons before handling detached
consumers, and add regression coverage for async and sync consumers.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #64705
Fixes: #64704
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream/iter: falsy cancellation reasons become clean EOF in broadcast and share

3 participants


Back | FazBrowse Home | New Git URL