Repository navigation
fix(pwa): do not intercept navigations so Chrome can retry HTTP/2 - #12767
Merged
diegosouzapw merged 2 commits intoSep 7, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
HouMinXi
force-pushed
the
fix/dashboard-stale-tab-refresh
branch
from
September 5, 2026 14:34
22bda89 to
9e4b046
Compare
Contributor
Author
|
Rebased onto range-diff every unique commit Own tests re-run on the new base.
|
HouMinXi
force-pushed
the
fix/dashboard-stale-tab-refresh
branch
from
September 6, 2026 08:10
9e4b046 to
c4381e5
Compare
Contributor
Author
Chrome cached Alt-Svc h3=":20128" (ma=2592000) from Caddy's default protocol list. UDP 20128 is unpublished, so a long-lived tab's refresh hit a dead QUIC socket. The service worker then respondWith()'d Response.error() and Chrome never retried HTTP/2. A new tab worked because it opened a fresh TCP connection. Leave navigations to the browser. Bump the PWA cache to v3 so existing workers update. Signed-off-by: Minxi Hou <houminxi@gmail.com>
startsWith("/dashboard") also matched /dashboardfoo. Strip a trailing
slash from each prefix, then require exact equality or `${base}/`.
Tested: 4/4 SW unit tests pass. Naive startsWith injection fails the
/dashboardfoo case; restore is green again.
Signed-off-by: Minxi Hou <houminxi@gmail.com>
HouMinXi
force-pushed
the
fix/dashboard-stale-tab-refresh
branch
from
September 7, 2026 02:35
c4381e5 to
ff0f718
Compare
Contributor
Author
|
Rebased onto
|
diegosouzapw
merged commit Sep 7, 2026
6d6b602
into
cheaper-inference:release/v3.8.51
8 of 16 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…eaper-inference#12767) Validado numa worktree combinada com as 16 PRs desta leva sobre `release/v3.8.51`: typecheck:core limpo, check-file-size e check-changelog-integrity OK, complexity 2788/3218 e cognitive 1261/1437 (ambos sob a baseline), ESLint 0 erros nos 152 arquivos alterados, 771 testes unitários focados, 49 de integração e a suíte vitest:ui completa (2149) verdes. A separação entre o que é do service worker e o que é do Caddy está certa e é o que torna a PR mergeável: o `respondWith` em navegação é defeito nosso, o `Alt-Svc` mentindo h3 é config de proxy reverso e não tem o que fazer aqui. O `/dashboardfoo` casando com `startsWith("/dashboard")` é um achado à parte, e o bump de cache v2→v3 é o que faz o worker antigo sair do ar nos clientes que já estão presos.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
A Chrome tab left on
/dashboard/quotaeventually fails to reload. F5 times out. A new tab on the same origin loads immediately.curlagainst the origin stays 200.Seen on both a LAN HTTPS origin (TCP 20128, no UDP) and a Cloudflare-fronted hostname.
Cause
Two things stack:
protocols = [h1 h2 h3]and sendsAlt-Svc: h3=":<port>"; ma=2592000. If the process only publishes TCP, that advertisement is a lie. Chrome caches it for 30 days and retries QUIC on F5. UDP never answers.public/sw.jscalledevent.respondWithonmode:navigatefor/dashboard/*. On a dead QUIC socket the worker'sfetch()hangs or errors, andResponse.error()aborts the document load. Chrome never gets to fall back to HTTP/2 on that tab. A new tab opens a fresh TCP handshake, so it works.This PR only changes the service worker. The Caddy
protocols h1 h2+header Alt-Svc "clear"fix belongs in the reverse-proxy config, not here.pathname.startsWith("/dashboard")also matched/dashboardfoo. Second commit requires a path-segment boundary.Change
respondWith. The browser owns the document load and the H3→H2 retry.omniroute-pwa-v2→omniroute-pwa-v3so existing clients drop the old worker.pathIsExcluded: strip a trailing slash, then exact match or${base}/.style/script/image/font) stay cache-first.No custom offline HTML for navigations. Serving a stale shell from the worker is what hung F5. Offline dashboard is a follow-up.
Tests
4/4 pass. Naive
startsWithinjection fails/dashboardfoo; restore is green.node --check public/sw.jsis clean. CI shards also ran the four#11779/#5165cases green.After merge + deploy: F5 a stale tab on
/dashboard/quotawithout opening a new one. If the tab is still on v2, unregister the worker in DevTools or wait for v3 to activate.WAN
h3=":443"from Cloudflare is a real listener. Leave it.This PR does not touch
open-sse/executors/glm.ts,changelog.d/fixes/reset-aware-model-family.md,stryker.conf.json, or the sanitizer / stream-boundary tests that failed on CI. Those gates are already red onrelease/v3.8.51(same changelog fragment on sibling #12733; glmTS2554baseline 0→1; mutation list missingtests/unit/reset-aware-request-scope-12600.test.ts). Not fixing them here.