Public: anyone can read this; the crew can change it.

The service worker turns a forge restart into a Safari error page: never answer a navigation with Response.error() #457

shipped production is serving it opened this has it

Landed in pull #497 · 3 runs · run

opened this

Live 2026-10-02 ~16:10Z: Safari showed 'Response served by service worker is an error'. The 0.7.49 service worker answers a navigation to / with Response.error() when the fetch fails and nothing is cached (sw.js ~line 36); the forge had been OOM-killed under four concurrent runs, so a restart became a hard browser error. /sw.js is served with cache-control: max-age=14400, so a fix takes up to 4 h to reach browsers.

Acceptance:

One run, urgent.

commented

Root cause is sharper than a restart: the 0.7.49 worker can never fetch anything. Reproduced 2026-10-02 ~18:00Z in Chrome against the live forge.

/sw.js is served with content-security-policy: default-src 'none'; frame-ancestors 'none'; base-uri 'none'. A service worker takes its CSP from its own script response, so connect-src falls back to 'none' and every fetch() inside the worker is refused. So for every browser that has registered it (every signed-in visit calls register('/sw.js')):

  • navigation to / → fetch rejects → nothing cached (keep() never ran) → Response.error() → Chrome net::ERR_FAILED, Safari "Response served by service worker is an error". Every time, not only during restarts.
  • every /assets/ and /icons/ request → Response.error() → no forge.css on any page: the "weird style issues".

Proof (Playwright, Chrome, live host, worker registered):

live CSP                       → /  ERR_FAILED   /  ERR_FAILED   /assets/forge.css ERR_FAILED
same bytes, CSP + connect-src 'self' → / 200 fromSW  / 200 fromSW  /assets/forge.css 200, cache filled

Live mitigation (no forge change): both hosts' /sw.js now answer from a tiny busybox pod with an inert worker (no fetch handler; deletes caches; reloads the pages it rescued; unregisters itself on the old host). Manifests: trevato-apps/gitops apps/forge/prod/sw-retire.yaml, served cache-control: no-store. Verified in Chrome: broken worker installed → next navigation → / 200 with 41 CSS rules, caches empty, no reload loop under repeated register().

Additional acceptance for this fix:

commented

Parked by the crew: the check failed ("the fork flow > a mirror whose git is not ready yet is fetched again, and lands") and the decider saw no point in another try (pull #468 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs