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

I certainly have not considered all the potential scenarios, but I also find it odd that you can even response with an empty view *after* closing a stream (and doing so before you close the stream is an error).  What I would expect is:
* After calling `close()` you can no longer respond and doing so would be an error. In most cases, I'd think this is a coding mistake (except in this scenario we're discussing, which seems like it shouldn't exist).
* Responding with zero length view would either never an error or always an error.
* As you proposed, calling `close()` would create an empty view automatically. But consider doing that based on the lack of a response rather than attached or detached buffer since it will be less error prone to have consistent behavior (aka the original BYOD view is always detached).

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

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

Received on Sunday, 11 August 2024 01:44:46 UTC