[whatwg/streams] Stream read hangs when stream is closed during a BYOD read (Issue #1321)

### What is the issue with the Streams Standard?

When constructing a ReadableStream and then reading it with a ReadableStreamBYOBReader (for example to control the size of reads), if the stream is closed during the read request without enqueued data, the read request hangs. This is problematic when the stream is used from a library by unknown callers. The solution is to not ignore BYOD in the stream implementation and call `close()` followed by `controller.byobRequest.respond(0)`, but that is unexpected when the readable stream otherwise ignores BYOD.

More detail, code examples, and the workaround can be found in this Stack Overflow question: https://stackoverflow.com/questions/78804588/why-does-read-not-return-in-byob-mode-when-stream-is-closed


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1321
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1321@github.com>

Received on Wednesday, 7 August 2024 18:08:23 UTC