Monorepo for Aesthetic.Computer aesthetic.computer

prompt + bios: drop SW module cache the moment a new deploy is detected master

The piece-runs telemetry from the iPhone showed a familiar pattern: prompt.mjs's version poll surfaces "📦 New deployment detected: <hash>" within ~1s of cap loading, but the page is still running last-deploy's cached bios.mjs / disk.mjs (so the new bios's camera:debug events never get sent — and any rotation/UX fixes don't take effect). Now when prompt sees the version flip: - prompt.mjs send()s a new "sw:clear-cache" message to the main thread (it can't talk to the SW directly because it runs in a Web Worker). - bios.mjs catches it in receivedChange and calls navigator.serviceWorker.controller.postMessage("clearCache"), which the SW already knows how to handle (caches.delete(CACHE_NAME)). We don't auto-reload — that'd interrupt mid-task — but the cache eviction means the user's next manual reload pulls genuinely fresh modules instead of stale-while-revalidating for up to an hour. Should noticeably tighten the fix-deploy-test loop, especially on the iOS app where WKWebView's HTTP cache compounds with the SW's.


+26
2 changed files