Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/node): fix node:stream.Writable #21297

Merged
merged 3 commits into from
Nov 23, 2023

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Nov 22, 2023

The current implementation of Writable of node:stream has an issue in handling onConstruct callback. When writable.write is called at certain timing near the end of writable._construct, that chunk overtakes the chunks that are stored in the internal buffer of writable. See examples in #20456 for details.

Node.js had a very similar (probably the same) issue nodejs/node#46765, and it was fixed by nodejs/node#46818.

This PR applies the same fix as nodejs/node#46818, and the original example given in #20456 works as expected.

closes #20456

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, nice investigation!

@kt3k kt3k merged commit bf42467 into denoland:main Nov 23, 2023
14 checks passed
@kt3k kt3k deleted the fix-node-stream-writable branch November 23, 2023 00:57
crowlKats pushed a commit that referenced this pull request Nov 24, 2023
This change applies the same fix as
nodejs/node#46818, and the original example
given in #20456 works as expected.

closes #20456

(cherry picked from commit bf42467)
bartlomieju pushed a commit that referenced this pull request Nov 24, 2023
This change applies the same fix as
nodejs/node#46818, and the original example
given in #20456 works as expected.

closes #20456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decompressing gzip stream from node-fetch response leads to different output in Deno vs Node
2 participants