Skip to content

stream: validate streams in pipeline#62214

Draft
efekrskl wants to merge 2 commits intonodejs:mainfrom
efekrskl:feat/validate-streams-in-pipeline
Draft

stream: validate streams in pipeline#62214
efekrskl wants to merge 2 commits intonodejs:mainfrom
efekrskl:feat/validate-streams-in-pipeline

Conversation

@efekrskl
Copy link
Contributor

@efekrskl efekrskl commented Mar 11, 2026

Towards #55305

I still need to add the tests, but I'd appreciate some early feedback on the approach.

@nodejs-github-bot
Copy link
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 Mar 11, 2026
@Renegade334
Copy link
Member

For reviewers/releasers: all of the cases at #55305 lead to failure states, therefore this should not be a major change.

} else if (isIterable(stream) || isReadableNodeStream(stream) || isTransformStream(stream)) {
ret = stream;
} else {
ret = Duplex.from(stream);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I see by validating and throwing early this becomes dead code. This is the branch for the "source stream" and the only case this was being used was a non-readable node stream which will now throw

}
ret = stream;
} else {
ret = Duplex.from(stream);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

@efekrskl efekrskl Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to above, unless I'm missing something with the early validation this becomes dead code. I'm less confident on this one though 😅

@efekrskl efekrskl requested a review from mcollina March 12, 2026 16:53
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.

5 participants