Re: [w3c/ServiceWorker] Reuse network response on both network and fetch handler failed (PR #1777)

@yoshisatoyanagisawa commented on this pull request.



> @@ -3263,16 +3263,21 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
                   1. Let |queue| be an empty [=queue=] of [=race result=].
                   1. Let |raceFetchController| be null.
                   1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "<code>pending</code>".
+                  1. Let |networkFetchCompleted| be false.
+                  1. Let |networkFetchResult| be null.

Current `raceResponse` may not be suitable for that purpose because its `value` represents `response`, `network error`, or null.  We want `response` instead.  I guess the structure is needed to make it used for [Create Fetch Event and Dispatch](https://w3c.github.io/ServiceWorker/#create-fetch-event-and-dispatch).

Then, I guess there are two options:
1. introduce a new variable (which this PR does now).
2. expand `raceResponse` (I mean its structure) to keep `response` even for network error.

Which one do you prefer?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1777#discussion_r2141755266
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1777/review/2919604404@github.com>

Received on Thursday, 12 June 2025 05:39:10 UTC