Re: [whatwg/streams] Test or specification problem with TransformStream readable.cancel and calling controller.error (Issue #1296)

Our investigation so far found that:

1. [InitializeTransformStream](https://streams.spec.whatwg.org/#initialize-transform-stream) defines a start algorithm that returns startPromise.
1. That start algorithm is called by SetUpWritableStreamDefaultController and is used to create another startPromise at [step 15 and 16](https://streams.spec.whatwg.org/#set-up-writable-stream-default-controller)
3. The step 15 uses "a promise resolved with", which creates a new promise that waits for the input promise in this case.
4. So the listener of startPromise of WritableStream takes two round to run here.
5. Since the listener of cancelPromise of TransformStreamDefaultSourceCancelAlgorithm only takes one round, it runs earlier than the start promise.

But I haven't found why the start promise listener still runs earlier than the cancel promise listener in the reference implementation.

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

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

Received on Tuesday, 17 October 2023 19:18:06 UTC