[whatwg/streams] Aborting a writable stream should not abort writes in progress (#611)

I am spinning this off from https://github.com/whatwg/streams/pull/607 so we can land that separately. The test in question is "Aborting a WritableStream prevents further writes after any that are in progress", which I have updated to expect that the write() fulfills, but currently it fails (if uncommented) with the aborted TypeError.

The problem is essentially that abort() synchronously rejects all pending write requests, whereas WritableStreamDefaultControllerProcessWrite does not unshift the pending write request until the underlying sink's write() call succeeds, which happens asynchronously.

We should instead unshift the pending write request the moment the underlying sink write() call is made, I think. This matches better the idea that once the underlying sink write() has started, it is entirely up to the underlying sink whether the writer.write() call should fulfill or reject. But a quick attempt to do that leads to lots of test timeouts and other failures. I would appreciate help investigating ways of making the test pass.

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

Received on Monday, 14 November 2016 23:34:34 UTC