-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Unable to completely read data from 'bytes' ReadableStream #48233
Comments
Also cc @nodejs/whatwg-stream |
I found the issue and have a fix, I'll create a PR later. From what I've found, |
Fix reader.read promise not fulfilling when the controller is closed when the reader is a BYOBReader fixes: nodejs#48233
I take back my previous statement... I think I understand what the issue is, and I managed to create a fix (at least it passed both wpt tests and Node's own tests) - however as I understand it - the implementation is directly from the spec. I checked and this also reproduces on Deno as well. |
Thats quite weird |
I just tried executing your code in the devtools, and I see the same behavior as in Node and Deno. Simpler example:
|
This is indeed spec compliant behvaiour in order to end byob streams we have to send a |
Version
20.2.0
Platform
Darwin Debadree-MacBook-Pro.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64
Subsystem
Web streams
What steps will reproduce the bug?
Run the following script in node and in chrome
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The stream should consume all the elements in the
toPull
array and we must be able to subsequently read this data back, the behaviour is correct in chrome.What do you see instead?
No output
Additional information
I tried investigating a little, its possible that there is some hanging promise before the closing of the stream. for example if you logged the values in each step the output would be like this
note that console to print the chunks array is not printed
The text was updated successfully, but these errors were encountered: