-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
write can emit out of order chunks on a partial flush #27
Comments
everett1992
changed the title
write can emit errors on a partial flush
write can emit out of order chunks on a partial flush
Dec 1, 2021
everett1992
pushed a commit
to everett1992/minipass
that referenced
this issue
Dec 1, 2021
Reproduces isaacs#27, cause of npm/cli#3884
everett1992
pushed a commit
to everett1992/minipass
that referenced
this issue
Dec 1, 2021
Reproduces isaacs#27, cause of npm/cli#3884
everett1992
pushed a commit
to everett1992/minipass
that referenced
this issue
Dec 1, 2021
4c5a106 handled a convoluted case where there is a chunk in the buffer AND we're in a flowing state during a write call which caused out of order writes. The fix was to flush the buffer before emitting the new chunk, but it didn't account for destinations pausing the stream after flushing part of the buffer. This caused issues in npm/pacote/npm-registry-fetch. That specific issue is demonstrated in everett1992/make-fetch-happen-tar-extract-error and occurs when make-fetch-happen res.body is piped to a tar.extract stream. Fixes isaacs#27 npm/cli#3884 make-fetch-happen#63
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
minipass/index.js
Lines 166 to 168 in 9bfcf55
minipass/index.js
Line 303 in 9bfcf55
If there is more than one chunk in in the buffer list then flush may not write all chunks before a consumer returns false and the stream emits the new chunk the chunks remaining in buffer.
This bug is demonstrated here and causes npm/cli#3884
The text was updated successfully, but these errors were encountered: