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

stream: handle sync writev completion in pipeTo by trivikr · Pull Request #63561 · nodejs/node · GitHub

/ node Public

stream: handle sync writev completion in pipeTo - #63561

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-sync-writev-undefined
Jun 1, 2026
Merged

stream: handle sync writev completion in pipeTo#63561
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:stream-iter-sync-writev-undefined

Conversation

trivikr commented May 25, 2026

Copy link
Copy Markdown
Member

Fixes: #63560

Fixes stream/iter pipeTo() when a duck-typed writer accepts a batched
writev() synchronously and returns undefined.

pipeTo() already tolerated undefined from single write() calls, but the
writev() path passed the return value directly to PromisePrototypeThen(),
which caused a TypeError for synchronous completion.


Assisted-by: openai:gpt-5.5

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 May 25, 2026
Treat writer.writev() returning undefined as synchronous success to
match the existing write() fallback behavior for duck-typed writers.
This avoids calling Promise.prototype.then on undefined after a batch
write has already been accepted.

Fixes: nodejs#63560

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
trivikr force-pushed the stream-iter-sync-writev-undefined branch from 13ee76d to 825d2c9 Compare May 25, 2026 16:51

codecov Bot commented May 25, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.32%. Comparing base (49dcaa0) to head (825d2c9).
⚠️ Report is 72 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63561      +/-   ##
==========================================
- Coverage   90.33%   90.32%   -0.02%     
==========================================
  Files         730      730              
  Lines      234362   234472     +110     
  Branches    43906    43916      +10     
==========================================
+ Hits       211713   211781      +68     
- Misses      14371    14433      +62     
+ Partials     8278     8258      -20     
Files with missing lines Coverage Δ
lib/internal/streams/iter/pull.js 88.21% <100.00%> (+0.09%) ⬆️

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

trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label May 26, 2026
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 26, 2026

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

trivikr added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels May 28, 2026
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 1, 2026
nodejs-github-bot merged commit c126cbf into nodejs:main Jun 1, 2026
87 of 88 checks passed

Copy link
Copy Markdown
Collaborator

Landed in c126cbf

trivikr deleted the stream-iter-sync-writev-undefined branch June 4, 2026 05:02
aduh95 pushed a commit that referenced this pull request Jun 18, 2026
Treat writer.writev() returning undefined as synchronous success to
match the existing write() fallback behavior for duck-typed writers.
This avoids calling Promise.prototype.then on undefined after a batch
write has already been accepted.

Fixes: #63560

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: #63561
Fixes: #63560
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit to aduh95/node that referenced this pull request Jul 30, 2026
Treat writer.writev() returning undefined as synchronous success to
match the existing write() fallback behavior for duck-typed writers.
This avoids calling Promise.prototype.then on undefined after a batch
write has already been accepted.

Fixes: nodejs#63560

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: nodejs#63561
Fixes: nodejs#63560
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 6, 2026
Treat writer.writev() returning undefined as synchronous success to
match the existing write() fallback behavior for duck-typed writers.
This avoids calling Promise.prototype.then on undefined after a batch
write has already been accepted.

Fixes: #63560

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: #63561
Backport-PR-URL: #64675
Fixes: #63560
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

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. 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: pipeTo() crashes when synchronous writev() returns undefined

3 participants


Back | FazBrowse Home | New Git URL