fix: SW cache bust — add JS modules + locales to STATIC_ASSETS
CI / lint (push) Failing after 24s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Failing after 11s

Root cause: cacheFirstStatic() in sw.js was caching viewer.js,
i18n.js, auth.js, dashboard.js, and locale JSON files under the old
CACHE_VERSION. Even after rebuild, the old SW served stale cached
files without data-i18n attributes, so dashboard stayed in French.

Changes:
- sw.js: add js/viewer.js, js/i18n.js, js/auth.js, js/dashboard.js,
  js/app.js, locales/en.json, locales/fr.json to STATIC_ASSETS
  so they are versioned with CACHE_VERSION and properly invalidated
- CACHE_VERSION already bumped to v5 in previous commit

Manual fix for existing clients:
  Chrome → F12 → Application → Service Workers → Unregister
  Or: chrome://serviceworker-internals/ → Unregister
  Then Ctrl+Shift+R to hard-refresh
This commit is contained in:
2026-06-21 11:53:58 -04:00
parent bea23820ab
commit 72622f3dfb
+8 -1
View File
@@ -10,7 +10,14 @@ const STATIC_ASSETS = [
'/static/index.html',
'/static/app.js',
'/static/style.css',
'/static/manifest.json'
'/static/manifest.json',
'/static/js/viewer.js',
'/static/js/i18n.js',
'/static/js/auth.js',
'/static/js/dashboard.js',
'/static/js/app.js',
'/static/locales/en.json',
'/static/locales/fr.json'
];
/* ── Install ── */