diff --git a/docs/index.bs b/docs/index.bs index bf094df7..8feebc45 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -3265,11 +3265,10 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "pending". 1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "terminated" or "aborted": 1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|: + 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. 1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then: - 1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|. 1. Let |raceNetworkResult| be a [=race result=] whose [=race result/routed response=] is |raceNetworkRequestResponse| and [=race result/used route=] is {{RouterSourceEnum/"network"}}. 1. [=queue/Enqueue=] |raceNetworkResult| to |queue|. - 1. Otherwise, set |raceResponse|'s [=race response/value=] to a [=network error=]. 1. [=If aborted=] and |raceFetchController| is not null, then: 1. [=fetch controller/Abort=] |raceFetchController|. 1. Set |raceResponse| to a [=race response=] whose [=race response/value=] is null. @@ -3282,6 +3281,8 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Wait until |queue| is not empty. 1. Let |result| be the result of [=dequeue=] |queue|. 1. Let |routedResponse| be |result|'s [=race result/routed response=]. + 1. If |routedResponse| is null: + 1. Return |timingInfo|. 1. If |result|'s [=race result/used route=] is {{RouterSourceEnum/"network"}}, then: 1. Set |routedResponse|'s [=service worker timing info=] be set to |timingInfo|. 1. Set |routedResponse|'s [=service worker timing info=]'s [=service worker timing info/worker final router source=] be set to |result|'s [=race result/used route=]. @@ -3340,6 +3341,9 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. Let |eventHandled| be null. 1. Let |handleFetchFailed| be false. 1. Let |respondWithEntered| be false. + 1. Let |networkError| be a [=network error=]. + 1. If |raceResponse| is not null: + 1. Set |networkError|'s [=response/service worker timing info=] to |timingInfo|. 1. Let |shouldSoftUpdate| be true if any of the following are true, and false otherwise: * |request| is a [=non-subresource request=]. * |request| is a [=subresource request=] and |registration| is [=stale=]. @@ -3399,15 +3403,15 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. If |respondWithEntered| is false, then: 1. If |eventCanceled| is true, then: 1. If |eventHandled| is not null, then [=reject=] |eventHandled| with a "{{NetworkError}}" {{DOMException}} in |workerRealm|. - 2. Return a [=network error=]. + 2. Return |networkError|. 1. If |eventHandled| is not null, then [=resolve=] |eventHandled|. - 1. If |raceResponse|'s [=race response/value=] is not null, then: + 1. If |raceResponse| is not null, and |raceResponse|'s [=race response/value=] is not null, then: 1. Wait until |raceResponse|'s [=race response/value=] is not "pending". 1. If |raceResponse|'s [=race response/value=] is a [=/response=], return |raceResponse|'s [=race response/value=]. 1. Return null. 1. If |handleFetchFailed| is true, then: 1. If |eventHandled| is not null, then [=reject=] |eventHandled| with a "{{NetworkError}}" {{DOMException}} in |workerRealm|. - 2. Return a [=network error=]. + 2. Return |networkError|. 1. If |eventHandled| is not null, then [=resolve=] |eventHandled|. 1. Return |response|.