Service worker: keep one version of each build file #258

Merged
littlefox merged 1 commit from issue-241-sw-cache into main 2026-10-22 00:53:19 +00:00
Owner

Closes #241

sw.js cached each hashed build file when first fetched and never removed old ones; the cache name never changes, so activate didn't either. Now caching a hashed file deletes cached versions with the same name minus the -dxh… hash.

Verified: new PWA test plants an older neokom_bg-dxh….wasm, removes the current one, reloads, and expects only the current one cached; it fails without the change (checked) and passes with it, on desktop and Android (service workers on http loopback are skipped on WebKit, as before).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #241 `sw.js` cached each hashed build file when first fetched and never removed old ones; the cache name never changes, so `activate` didn't either. Now caching a hashed file deletes cached versions with the same name minus the `-dxh…` hash. Verified: new PWA test plants an older `neokom_bg-dxh….wasm`, removes the current one, reloads, and expects only the current one cached; it fails without the change (checked) and passes with it, on desktop and Android (service workers on http loopback are skipped on WebKit, as before). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Service worker: keep one version of each build file
All checks were successful
ci / check (push) Successful in 12m37s
ci / desktop (push) Successful in 23m55s
ci / e2e (push) Successful in 37m2s
3d583f6695
Hashed build files were cached the first time they were fetched and never
dropped: every release, and every home-container build, left another
wasm behind on each device. Caching one now drops the other versions with
the same name minus the hash. The PWA spec plants an older wasm and
checks it is gone after the current one is fetched again; it failed
before.

Closes #241

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
littlefox referenced this pull request from a commit 2026-10-22 14:11:05 +00:00
Sign in to join this conversation.
No description provided.