Re: [whatwg/streams] Release reader immediately when shutting down a pipe (PR #1208)

@MattiasBuelens commented on this pull request.



> +        if (dest._state !== 'writable' || WritableStreamCloseQueuedOrInFlight(dest) === true) {
+          return promiseResolvedWith(true);
+        }

This implements @domenic's suggestion from https://github.com/whatwg/streams/issues/1207#issuecomment-1015851512.

I don't know if we need to update the spec text for this. It already specifies that these checks *must* happen before performing *any* reads and writes:
> **Shutdown must stop activity:** if _shuttingDown_ becomes true, the user agent must not initiate further reads from _reader_, and must only perform writes of already-read chunks, as described below. In particular, the user agent must check the below conditions before performing any reads or writes, since they might lead to immediate shutdown.

We should still add a test for this particular case (although that might not be easy looking at the discussion in #1207).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1208#pullrequestreview-857438856
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/pull/1208/review/857438856@github.com>

Received on Wednesday, 19 January 2022 22:37:25 UTC