Skip to content

Commit ef029c5

Browse files
Fix: Ensure timingInfo is returned on network fallback if SW static routing API is used (#1774)
According to the explainer, the worker final router source should be 'network' for a network fallback. The |timingInfo| is returned to make that happen. https://github.com/WICG/service-worker-static-routing-api/blob/main/resource-timing-api.md#correspondence-of-the-matched-source-type-and-the-actual-source-type
1 parent 2c732f5 commit ef029c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/index.bs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3310,8 +3310,12 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
33103310
1. [=fetch controller/Abort=] |preloadFetchController| with |deserializedError|.
33113311
1. Else, resolve |preloadResponse| with undefined.
33123312
1. Let |fetchResult| be the result of [=Create Fetch Event and Dispatch=] with |request|, |registration|, |useHighResPerformanceTimers|, |timingInfo|, |workerRealm|, |reservedClient|, |preloadResponse|, and null.
3313-
1. If |fetchResult| is not null and |fetchResult|'s [=response/service worker timing info=]'s [=service worker timing info/worker final router source=] is set to {{RouterSourceEnum/"network"}}:
3314-
1. Set |fetchResult|'s [=response/service worker timing info=]'s [=service worker timing info/worker final router source=] to {{RouterSourceEnum/"fetch-event"}}.
3313+
1. If |timingInfo|'s [=service worker timing info/worker final router source=] is not an empty string:
3314+
1. Assert |timingInfo|'s [=service worker timing info/worker final router source=] is {{RouterSourceEnum/"network"}}.
3315+
1. If |fetchResult| is null, then return |timingInfo|.
3316+
1. Else:
3317+
1. Assert |fetchResult|'s [=response/service worker timing info=]'s [=service worker timing info/worker final router source=] is {{RouterSourceEnum/"network"}}.
3318+
1. Set |fetchResult|'s [=response/service worker timing info=]'s [=service worker timing info/worker final router source=] to {{RouterSourceEnum/"fetch-event"}}.
33153319
1. Return |fetchResult|.
33163320
</section>
33173321

0 commit comments

Comments
 (0)