fix: Ensure Duplex streams are returned unwrapped in stream operators #55394
fix: Ensure Duplex streams are returned unwrapped in stream operators #55394KunalKumar-1 wants to merge 3 commits intonodejs:mainfrom
Duplex streams are returned unwrapped in stream operators #55394Conversation
|
Review requested:
|
|
Please add a test |
01ed513 to
90ac00d
Compare
|
@redyetidev test added |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #55394 +/- ##
==========================================
- Coverage 88.41% 88.35% -0.07%
==========================================
Files 652 652
Lines 186878 186897 +19
Branches 36061 36024 -37
==========================================
- Hits 165226 165126 -100
- Misses 14902 15017 +115
- Partials 6750 6754 +4
|
|
@mcollina why the test cases are failing ? |
|
@ronag I see your point regarding the stream semantics. If performance impact is minimal, then returning an explicit Readable does make sense to clarify the intended use. |
Well if consider my concern. Then we should just leave this as is? We might ned update docs/typings to clarify that if the first param (this) to |
|
Alternatively returning a new |
After considering both options, would it be preferable to return a new Duplex with I’m inclined to go with whichever approach aligns best with the project’s consistency and performance considerations ! |
|
I'm happy with the |
Yeah , sure It sounds great. |
It's worth mentioning that this is already what's returned by the internal Indeed, if the desired behaviour of |
Updated the implementation of the
readable.compose()method to ensure that it correctly returns a Duplex stream when applicable, avoiding unintended conversion to Readable streams.fixes: #55203