A worker that stops the page from booting had no exit: every off switch was page code. A REMOVE_REGISTRATION release now writes a service-worker.js that skips waiting and unregisters itself (D-5), checked end to end in the browser. The runbook and rollback doc now name only paths that exist in code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
837 B
TypeScript
18 lines
837 B
TypeScript
/**
|
|
* 06-03 (D-5). The emergency exit for a worker that stops the page from
|
|
* booting. A `REMOVE_REGISTRATION` release writes this as `service-worker.js`.
|
|
* The browser's own update check (navigation, `updateViaCache: "none"`) then
|
|
* installs it over any worker of this scope without a page: it skips waiting,
|
|
* and on activation unregisters the registration. It has no fetch handler, so
|
|
* every request goes to the network. Owned caches stay for the
|
|
* `PURGE_OWNED_RESOURCES` release, as with the page-side removal.
|
|
*/
|
|
export const SELF_UNREGISTERING_SERVICE_WORKER = `// Generated by scripts/build-frontend.ts (REMOVE_REGISTRATION).
|
|
self.addEventListener("install", (event) => {
|
|
event.waitUntil(self.skipWaiting());
|
|
});
|
|
self.addEventListener("activate", (event) => {
|
|
event.waitUntil(self.registration.unregister());
|
|
});
|
|
`;
|