Re: [whatwg/streams] async iteration over a ReadableStream containing a rejected Promise will not clean up (Issue #1266)

The normal state of affairs is that the async iterable will clean itself up when it encounters an error. For example, for [streams](https://streams.spec.whatwg.org/#rs-asynciterator-prototype-next), the "error steps" for the read request will release the reader before it yields a rejected promise - i.e., it's already doing cleanup.

The problem here arises specifically when vending a rejected promise, because then the readable stream does not think it has errored (and so will not do its own cleanup) but the async iteration machinery does (and so does not tell it to clean up).

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

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

Received on Wednesday, 5 April 2023 14:53:53 UTC