// Clawmates service worker — KILL SWITCH. // // A previous caching service worker (tc-static-v*) could serve stale or // mismatched /_next/static chunks after a deploy, which broke client-side // hydration (React Flow nodes stayed `visibility:hidden`, blank dashboard). // Rather than ship another caching SW, this version removes the SW entirely: // it deletes every cache and unregisters itself, returning every client to a // clean, network-only state. There is intentionally no `fetch` handler, so the // browser handles all requests directly even before unregister completes. // // Re-register loops are avoided because the new RegisterServiceWorker no longer // calls register() — it only cleans up (see RegisterServiceWorker.tsx). self.addEventListener("install", () => { self.skipWaiting(); }); self.addEventListener("activate", (event) => { event.waitUntil( (async () => { for (const key of await caches.keys()) { await caches.delete(key); } await self.clients.claim(); await self.registration.unregister(); })(), ); });