Skip to content

stream: fix merge handling for object-like sources - #63356

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
trivikr:stream-iter-merge-object-like
May 17, 2026
Merged

stream: fix merge handling for object-like sources#63356
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
trivikr:stream-iter-merge-object-like

Conversation

@trivikr

Copy link
Copy Markdown
Member

merge() previously treated any final non-iterable object as an options
object, which dropped valid inputs that from() accepts, including
ArrayBuffer, ArrayBufferView, and objects implementing
Stream.toStreamable or Stream.toAsyncStreamable.

This updates the options-object heuristic to preserve those valid source
types and adds regression coverage for the affected cases.

Fixes: #63355


Assisted-by: openai:gpt-5.5

merge() treated any final non-iterable object as an options object.
That dropped valid from() inputs such as ArrayBuffer, ArrayBufferView,
and streamable protocol objects.
Fixes: nodejs#63355
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-botnodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels May 15, 2026
Comment threadlib/internal/streams/iter/consumers.js Outdated
@codecov

codecovBot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (2d6cbea) to head (2502bfe).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #63356 +/- ##
==========================================
- Coverage 90.06% 90.05% -0.01% 
==========================================
Files 714 714 Lines 225502 225524 +22 Branches 42628 42639 +11 ==========================================
+ Hits 203089 203090 +1 - Misses 14195 14218 +23 + Partials 8218 8216 -2 
Files with missing linesCoverage Δ
lib/internal/streams/iter/consumers.js96.61% <100.00%> (+0.05%)⬆️

... and 44 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
trivikr requested a review from Renegade334May 16, 2026 00:36
@trivikrtrivikr added the request-ci Add this label to start a Jenkins CI on a PR. label May 16, 2026
@trivikrtrivikr self-assigned this May 16, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 16, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikrtrivikr added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels May 16, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 17, 2026
@nodejs-github-bot
nodejs-github-bot merged commit bc90667 into nodejs:mainMay 17, 2026
82 of 83 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in bc90667

aduh95 pushed a commit that referenced this pull request May 19, 2026
merge() treated any final non-iterable object as an options object.
That dropped valid from() inputs such as ArrayBuffer, ArrayBufferView,
and streamable protocol objects.
Fixes: #63355
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: #63356Fixes: #63355
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
aduh95 pushed a commit that referenced this pull request May 19, 2026
merge() treated any final non-iterable object as an options object.
That dropped valid from() inputs such as ArrayBuffer, ArrayBufferView,
and streamable protocol objects.
Fixes: #63355
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: #63356Fixes: #63355
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
@trivikr
trivikr deleted the stream-iter-merge-object-like branch May 27, 2026 07:49
aduh95 pushed a commit to aduh95/node that referenced this pull request Jul 30, 2026
merge() treated any final non-iterable object as an options object.
That dropped valid from() inputs such as ArrayBuffer, ArrayBufferView,
and streamable protocol objects.
Fixes: nodejs#63355
Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: nodejs#63356Fixes: nodejs#63355
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.needs-ciPRs that need a full CI run.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream/iter: merge() treats valid object-like sources as options

4 participants

@trivikr@nodejs-github-bot@jasnell@Renegade334