From 4ddc59be08fc9acbb8d489f1acf5a52f65347c27 Mon Sep 17 00:00:00 2001 From: Kartikeya <176560021+karti-ai@users.noreply.github.com> Date: Sat, 27 Jun 2026 15:52:24 -0700 Subject: [PATCH] fix(frontend): self-destroying service worker to avoid stale UI during dev The precaching PWA SW was serving an old bundle after deploys (stale UI). Switch to selfDestroying so it unregisters + clears caches on all clients; deploys are now always fresh. Re-add a tuned PWA before the demo. Co-Authored-By: Claude Opus 4.8 --- frontend/vite.config.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index f953048..f2f8a8f 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -7,17 +7,10 @@ export default defineConfig({ plugins: [ react(), tailwindcss(), - VitePWA({ - registerType: 'autoUpdate', - manifest: { - name: 'PodMan', - short_name: 'PodMan', - description: 'Ambient AI teammate that prevents merge collisions before push', - theme_color: '#0b0f17', - background_color: '#0b0f17', - display: 'standalone', - }, - }), + // Self-destroying during active development: unregisters any previously + // installed service worker and clears its caches so deploys are always + // fresh (no stale UI). Re-enable a precaching PWA before the demo. + VitePWA({ selfDestroying: true }), ], server: { port: 5173,