This repository was archived by the owner on Mar 3, 2026. It is now read-only.
Merged
Conversation
danielbankhead
commented
Sep 6, 2023
| } | ||
| const returnValue = retry( | ||
| async (bail: (err: Error) => void) => { | ||
| if (data instanceof Readable) { |
Contributor
Author
There was a problem hiding this comment.
Removing this logic as for the vast majority it would simply slow down their uploads unnecessarily. Additionally, later versions of Node.js catch this for us.
Contributor
There was a problem hiding this comment.
Do you know what versions catch this?
Contributor
Author
There was a problem hiding this comment.
Node 18.0.0:
- stream: fix pipeline callback not called on ended stream nodejs/node#46600
- https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.0.0
Here's a simple reproduction for a REPL (anything before 18 the console.log isn't called):
const readable = stream.Readable({read() {this.push(null)}});
readable.read();
readable.readable // false
stream.pipeline(readable, stream.PassThrough, () => console.log('done'));
danielbankhead
commented
Sep 6, 2023
| file.save(generator(), options, (err: Error) => { | ||
| assert.strictEqual( | ||
| err.message, | ||
| 'The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object' |
Contributor
Author
There was a problem hiding this comment.
This is just testing Node internals. Removed.
ddelgrosso1
approved these changes
Sep 6, 2023
danielbankhead
commented
Sep 6, 2023
Comment on lines
-3690
to
-3695
| // If data is not a valid PipelineSource, then pipeline will | ||
| // fail without destroying the writable stream. If data is a | ||
| // PipelineSource that yields invalid chunks (e.g. a stream in | ||
| // object mode or an iterable that does not yield Buffers or | ||
| // strings), then pipeline will destroy the writable stream. | ||
| if (!writable.destroyed) writable.destroy(); |
Contributor
Author
There was a problem hiding this comment.
This case doesn't happen - instead, Node throws immediately and this callback is never called.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2278 🦕