Re: [whatwg/streams] Should cancelation error from UnderlyingSource be transferred too? (Issue #1259)

The short answer is that it's because transferable streams are implemented using a pipe, and pipes propagate cancellation without waiting.

Elaborating a bit, what we have is
```
original ---pipe---> writable <==CRIT==> transferred
```
(where "CRIT" means cross-realm identity transform). The internal pipe is invisible to developers, except to the extent that it dictates the semantics.

When `transferred` is cancelled, this is propagated back by erroring `writable`. Erroring is a synchronous operation, so there's no opportunity to wait.

When the pipe sees the `writable` is errored, it propagates it back by cancelling the `original` stream. Because `writable` is already errored, the results of cancellation cannot  be propagated back up the pipe.

See also https://github.com/whatwg/streams/issues/976.

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

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

Received on Monday, 27 February 2023 12:35:45 UTC