Skip to content

Commit 2c732f5

Browse files
Fix: Correct return type and preserve response timing info (#1773)
The commit introduces the following enhancements: 1. Type Correction for race-network-and-fetch-event: Modified the race-network-and-fetch-event algorithm to consistently return the correct value type. This addresses a previous inconsistency where the algorithm could yield a value of a different, incorrect type. 2. Preservation of Response Timing Information: Ensured that timing information within the response, particularly the fetch event dispatch time, is retained when the fetch event's value is utilized. This resolves an issue where such timing data was previously being discarded.
1 parent 4e9d705 commit 2c732f5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/index.bs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,9 +3281,11 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
32813281
1. [=queue/Enqueue=] |raceFetchHandlerResult| to |queue|.
32823282
1. Wait until |queue| is not empty.
32833283
1. Let |result| be the result of [=dequeue=] |queue|.
3284-
1. Set |timingInfo|'s [=service worker timing info/worker final router source=] be set to |result|'s [=race result/used route=].
3285-
1. Set |result|'s [=service worker timing info=] be set to |timingInfo|.
3286-
1. Return |result|'s [=/race response=].
3284+
1. Let |routedResponse| be |result|'s [=race result/routed response=].
3285+
1. If |result|'s [=race result/used route=] is {{RouterSourceEnum/"network"}}, then:
3286+
1. Set |routedResponse|'s [=service worker timing info=] be set to |timingInfo|.
3287+
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=].
3288+
1. Return |routedResponse|.
32873289
1. Assert: |source| is "{{RouterSourceEnum/fetch-event}}"
32883290
1. If |request| is a [=navigation request=], |registration|'s [=navigation preload enabled flag=] is set, |request|'s [=request/method=] is \`<code>GET</code>\`, |registration|'s [=active worker=]'s [=set of event types to handle=] [=set/contains=] <code>fetch</code>, and |registration|'s [=active worker=]'s [=all fetch listeners are empty flag=] is not set then:
32893291

0 commit comments

Comments
 (0)