Use a keepalive fetch to unblock the in-flight prefetch in speculation-rules no-vary-search/prefetch-single-with-hint.https.html
Categories
(Core :: DOM: Networking, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: smayya, Assigned: smayya, NeedInfo)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged], [wptsync upstream])
Attachments
(1 external file)
speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html checks that a navigation uses a prefetch that is still in flight, matched by the speculation rule's No-Vary-Search hint.
The server script prefetch_nvs_hint.py holds the prefetch response until it receives an unblock request. The test sends that request with a plain fetch() from the source page's onbeforeunload handler, expecting it to reach the server while the navigation is waiting for the prefetch.
In Firefox the new navigation cancels the source page's in-flight requests, so the unblock request is aborted right after it is sent (HttpChannelParent::RecvCancel, reason=navigation, NS_BINDING_ABORTED). The prefetch therefore never completes, the navigation stops waiting after dom.speculation_rules.wait_timeout_ms (bug 2071485) and falls back to a normal fetch, and every "use the in-flight prefetch" case fails or times out regardless of whether waiting for an in-flight prefetch works.
Sending the unblock request with fetch(unblock_url, {keepalive: true}) lets it outlive the page, which is what keepalive is for, and does not change what the test checks. With that change and the patch for bug 2071485 applied locally, 25 of the 28 variants pass (17 of them are currently expected to fail). The remaining failures are the non-ASCII key cases:
?25-25and?26-26("Don't vary the response on the non-ASCII key") still do not use the prefetch, as already expected.?27-27("Vary the response on the non-ASCII key") now uses the prefetch when it should not, the same problem as bug 2076692 inprefetch-single.https.html.
The test change should be upstreamed to web-platform-tests, and the expectations in prefetch-single-with-hint.https.html.ini updated to match.
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Firefox cancels the page's in-flight requests when a navigation starts, so the
plain fetch sent from onbeforeunload never reached the server and the in-flight
prefetch was never released.
Updated•1 month ago
|
Updated•1 month ago
|
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/64803 for changes under testing/web-platform/tests
Comment 5•24 days ago
•
|
||
Backed out for causing wpt and TV tests failures at flight prefetch
Backout Link
Push with failures
Failure Log
Failure line TEST-UNEXPECTED-PASS | /speculation-rules/prefetch/no-vary-search/prefetch-single-with-hint.https.html?26-26 | Use the in-flight prefetch. Non-ASCII key - 2 UTF-8 code units. Don't vary the response on the non-ASCII key. - expected FAIL
Upstream PR was closed without merging
Comment 8•21 days ago
|
||
| bugherder | ||
Upstream PR merged by moz-wptsync-bot
Updated•3 days ago
|
Description
•