sw.js carries a build stamp; the shots workflow writes the commit into it so installed apps notice every update
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K6897PWcUEwHiqZMcVnNF6
This commit is contained in:
1 parent
b4809dbbe1
commit
98541c5cf0
1 file changed
+3
-1
@@ -1,6 +1,8 @@
|
||||
// gandora's service worker: the shell is cached so the app opens and the library plays with no signal.
|
||||
// Tracks live in IndexedDB already; the DJ and new renders need the network and the page says so.
|
||||
const SHELL = "gandora-shell-v1";
|
||||
// REV is stamped by the shots workflow on every push, so an installed app sees each update as a new worker.
|
||||
const REV = "dev";
|
||||
const SHELL = "gandora-shell-" + REV;
|
||||
const FILES = ["/", "/index.html", "/brain.js", "/favicon.svg", "/manifest.json", "/icons/icon.svg"];
|
||||
self.addEventListener("install", (e) => { e.waitUntil(caches.open(SHELL).then((c) => c.addAll(FILES)).then(() => self.skipWaiting())); });
|
||||
self.addEventListener("activate", (e) => { e.waitUntil(caches.keys().then((ks) => Promise.all(ks.filter((k) => k !== SHELL).map((k) => caches.delete(k)))).then(() => self.clients.claim())); });
|
||||
|
||||
Reference in new issue
Block a user