Skip to content

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

Open
trivikr wants to merge 2 commits into
nodejs:mainfrom
trivikr:stream-iter-merge-object-like
Open

stream: fix merge handling for object-like sources#63356
trivikr wants to merge 2 commits into
nodejs:mainfrom
trivikr:stream-iter-merge-object-like

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 15, 2026

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-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 15, 2026
Comment thread lib/internal/streams/iter/consumers.js Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (2d6cbea) to head (2502bfe).
⚠️ Report is 4 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 lines Coverage Δ
lib/internal/streams/iter/consumers.js 96.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 Renegade334 May 16, 2026 00:36
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label May 16, 2026
@trivikr trivikr self-assigned this May 16, 2026
@github-actions github-actions Bot 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

@trivikr trivikr added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 16, 2026
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 pending requests for changes, 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: merge() treats valid object-like sources as options

4 participants