mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Between48f5e35(07.09., registerType: 'autoUpdate') and5b5f4ca(10.09., switched to 'prompt') every client that cached the app froze: the new worker sits in `waiting` and the only code that could release it - the update toast - lives in the build behind that worker. Their next update never arrives, and Pages deletes the hashed assets they still run from, so the bundle they serve does not exist on the server any more. That is how the feedback form went missing on client.webspeak3.de. - Back to 'autoUpdate', with skipWaiting/clientsClaim spelled out: the plugin only sets them when it also injects registerSW.js, so with injectRegister: false the generated worker was byte-identical to the 'prompt' one. Verified in dist/sw.js. - onNeedReload instead of onNeedRefresh: the worker takes over on its own, the toast only decides *when* to reload, so nobody is thrown out of a running connection. - version.json plus a __BUILD_ID__ baked into the bundle, checked every 30 min and on tab focus, deliberately routed around the worker (not in globPatterns, so never precached). If the server is on another build and no new worker turns up, the worker is wedged and the button clears registrations and caches instead of reloading into the same cache. - Dismissing the toast snoozes for 30 min rather than for good. Verified in headless Chromium against simulated deploys: a client stuck on the old worker lands on the new bundle at the first plain F5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
7 lines
245 B
TypeScript
7 lines
245 B
TypeScript
/// <reference types="vite/client" />
|
|
/// <reference types="vite-plugin-pwa/client" />
|
|
/// <reference types="vite-plugin-pwa/react" />
|
|
|
|
/** Injected by vite.config.ts; matches the `buildId` in version.json. */
|
|
declare const __BUILD_ID__: string
|