Closed Bug 2076767 Opened 1 month ago Closed 1 month ago

Navigation doesn't wait for an in-flight speculation-rules prefetch and fetches from the network instead

Categories

(Core :: DOM: Networking, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2071485

People

(Reporter: smayya, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

When a navigation starts while a matching speculation-rules prefetch is still in flight, Gecko doesn't wait for it. The navigation goes to the network and the prefetch is thrown away.

The wait step, "wait for a matching prefetch record" (https://wicg.github.io/nav-speculation/prefetch.html#wait-for-a-matching-prefetch-record), is implemented but never called. WindowGlobalParent::WaitForMatchingPrefetchRecord, PrefetchMatchWaiter and PrefetchRecordParent::IsExpectedToMatch (which applies the rule's expects_no_vary_search hint to an in-flight record) exist, but DocumentLoadListener::TryActivateFromPrefetch only calls WindowGlobalParent::FindMatchingPrefetchRecord, which checks completed records only.

Every subtest of speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html starts the navigation while the server is still holding the prefetch response. With the patches for bug 2070841 applied, all 19 subtests that expect the in-flight prefetch to be used fail (Navigation didn't use the prefetched response!), and all 9 that expect it not to be used pass.

https://wpt.fyi/results/speculation-rules/prefetch/no-vary-search?label=master&label=experimental&aligned&q=prefetch-single-with-hint.https.html

No longer blocks: 2076681
Severity: -- → S3
Priority: -- → P3
Blocks: 2076681
No longer blocks: 2037091
Whiteboard: [necko-triaged]
Status: NEW → RESOLVED
Closed: 1 month ago
Duplicate of bug: 2071485
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.