[whatwg/fetch] Update HTTPFetch algorithm to support new SW Handle Fetch returns (PR #1832)

This will update the HttpFetch algorithm, particularly the handling of the response for Service Worker fetch (`handle fetch` step). Currently, the response of handle fetch step is assumed to return the `response` type (or null, if the ServiceWorker couldn't handle the fetch and need to fallback to the network request). However, we have changed the `handle fetch` step to also return `service worker timing info` when the ServiceWorker static routing API used, so that the corresponding timing information are correctly exposed when the ServiceWorker could not handle the fetch. To support this new return type, we need to update the handling of the response of `handle fetch`.

To expose the Service Worker Timing Info to the resource timing API, we also associate them to the Fetch Timing Info so that it could be later referenced.

- [ ] At least two implementers are interested (and none opposed):
   * Chromium is proposing the change
   * Waiting for reponse from other vendors (will update once we get support).
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * https://wpt.fyi/results/service-workers/service-worker/tentative/static-router?label=experimental&label=master&aligned
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: https://g-issues.chromium.org/issues/41496865?pli=1&authuser=0
   * Gecko: https://github.com/mozilla/standards-positions/issues/1031
   * WebKit: https://github.com/WebKit/standards-positions/issues/354
   * Deno (not for CORS changes): N/A
- [ ] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: …
- [x] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/fetch/1832.html" title="Last updated on May 30, 2025, 1:23 AM UTC (19bc200)">Preview</a> | <a href="https://whatpr.org/fetch/1832/97f308e...19bc200.html" title="Last updated on May 30, 2025, 1:23 AM UTC (19bc200)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/fetch/pull/1832

-- Commit Summary --

  * Update HTTPFetch algorithm to support new SW Handle Fetch returns

-- File Changes --

    M fetch.bs (67)

-- Patch Links --

https://github.com/whatwg/fetch/pull/1832.patch
https://github.com/whatwg/fetch/pull/1832.diff

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

Message ID: <whatwg/fetch/pull/1832@github.com>

Received on Friday, 30 May 2025 01:23:56 UTC