[Bug]: ReadableStream is malformed when protocol.handle'd #41872
Labels
29-x-y
30-x-y
arch/arm64
bug 🪲
component/protocol
has-repro-gist
Issue can be reproduced with code at https://gist.github.com/
status/confirmed
A maintainer reproduced the bug or agreed with the feature
Preflight Checklist
Electron Version
30.x, 29.x
What operating system are you using?
macOS
Operating System Version
macOS 14.4.1
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
Expectation: The stream should come through intact.
Actual Behavior
The stream gets malformed.
In the attached fiddle gist, you can see two buttons.
Send always works.
Stream doesn't work. The resulting data (as evidenced by seeing its shasum) is different each time.
Testcase Gist URL
https://gist.github.com/mnvr/e08d9f4876fb8400b7615347b4d268eb
Additional Information
I hope I'm just missing something silly, but I tried to boil down the issue to a isolated gist, and I'm out of ideas about what to try next. I've tried with both the latest beta and the older stable 29.x.
FWIW, if the data is less than one chunk, the streaming seems to work fine (but then I guess it's not really streaming).
The gist also has a commented out await in the code that enqueues data to the stream. If we uncomment this, Stream starts to work - by adding a 1 second delay between these enqueues. But I'm not sure about this, smaller delays didn't work, and it is also possible that I've just been getting lucky with these 1 second delays.
The text was updated successfully, but these errors were encountered: