Re: [whatwg/streams] Should the abort result reflect the close result? (Issue #1203)

Some of the discussions in https://github.com/whatwg/streams/pulls?q=is%3Apr+pendingAbortRequest+is%3Aclosed , in particular https://github.com/whatwg/streams/pull/655 and https://github.com/whatwg/streams/pull/634, seem related.

> Note that the following code doesn't throw.

This is a bit surprising and indeed seems inconsistent.

In general it seems like this is an area we've spent a lot of time on involving some complicated structures like [[pendingAbortRequest]]. So that kind of inconsistency is surprising. What were we trying to accomplish? 😕

The for-web-developers documentation for abort() doesn't explain what happens in such scenarios, and we don't seem to have documented the intent anywhere else.

Some relevant tests starting here:

- https://github.com/web-platform-tests/wpt/blob/305cf97e20c9b5ab08fcf28a62c153f54536fbbf/streams/writable-streams/aborting.any.js#L231

- https://github.com/web-platform-tests/wpt/blob/305cf97e20c9b5ab08fcf28a62c153f54536fbbf/streams/writable-streams/aborting.any.js#L442 : this block includes the scenario here
- https://github.com/web-platform-tests/wpt/blob/305cf97e20c9b5ab08fcf28a62c153f54536fbbf/streams/writable-streams/aborting.any.js#L649 : these indicate that if you `controller.error()` during a close, that will cause `abortPromise` to *fulfill*
- https://github.com/web-platform-tests/wpt/blob/305cf97e20c9b5ab08fcf28a62c153f54536fbbf/streams/writable-streams/aborting.any.js#L1182 the scenario here again, maybe redundantly

Blame on the test file indicates maybe https://github.com/whatwg/streams/pull/672 is the cause.

So my best guess is that this is a historical accident and we should fix it to fulfill with undefined.  I wonder if that would allow simplifications (e.g. if some of the [[pendingAbortRequest]] machinery becomes less necessary?) I'd love more perspectives though.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1203#issuecomment-1006970809

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1203/1006970809@github.com>

Received on Thursday, 6 January 2022 22:10:02 UTC