Re: [whatwg/fetch] Editorial: remove some duplicate abort logic (#1187)

@domenic commented on this pull request.

Promise logic looks good, not so sure about stream logic.

> @@ -7906,14 +7906,6 @@ method steps are:
  <li><p>If <var>request</var>'s <a for=request>body</a> is not null and is
  <a for=ReadableStream>readable</a>, then <a for=ReadableStream>cancel</a> <var>request</var>'s
  <a for=request>body</a> with <var>error</var>.
-
- <li><p>If <var>responseObject</var> is null, then return.

What about if we're fetching from cache, not network? What about if we're fetching a blob?

Also, if this did go through, we'd delete the _responseObject_ argument.

>  
-   <li><p>If <var>controller</var> is not null, then <a for="fetch controller">abort</a>
-   <var>controller</var> with <var>requestObject</var>'s <a for=Request>signal</a>'s
-   <a for=AbortSignal>abort reason</a>.
+   <li><p><a for="fetch controller">Abort</a> <var>controller</var> with <var>requestObject</var>'s
+   <a for=Request>signal</a>'s <a for=AbortSignal>abort reason</a>.

Note to self: this does indeed work. Setting the controller's state will trigger various "abort when" conditions, both inside HTTP network-fetch, HTTP cache-fetch, and blob's part of scheme fetch. All those "abort when" conditions will eventually end up in processResponse with response set to a network error whose the aborted flag set, and that will call "abort the fetch() call".

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

Message ID: <whatwg/fetch/pull/1187/review/1148806756@github.com>

Received on Thursday, 20 October 2022 08:49:16 UTC