Skip to content

stream: handle falsy push writer fail reasons#63569

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-writer-fail-pending
Open

stream: handle falsy push writer fail reasons#63569
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-writer-fail-pending

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 25, 2026

This fixes stream/iter push writer reads after writer.fail() is called
with an explicit falsy reason.

Reads now use the writer state instead of the truthiness of the stored error,
so reasons like 0 and false reject correctly instead of leaving reads
pending.

Fixes: #63568


Assisted-by: openai:gpt-5.5

Reject reads based on writer state so explicit falsy fail reasons do
not leave reads pending.

Fixes: nodejs#63568

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.34%. Comparing base (b9203ee) to head (5f2ffe5).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/streams/iter/push.js 90.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #63569   +/-   ##
=======================================
  Coverage   90.34%   90.34%           
=======================================
  Files         730      730           
  Lines      234463   234468    +5     
  Branches    43914    43918    +4     
=======================================
+ Hits       211816   211834   +18     
- Misses      14367    14370    +3     
+ Partials     8280     8264   -16     
Files with missing lines Coverage Δ
lib/internal/streams/iter/push.js 92.06% <90.00%> (+0.05%) ⬆️

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

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: writer.fail(0) can leave async iterator readers pending forever

2 participants