Problem
The app is configured with registerType: 'autoUpdate' (vite.config.js), but on iOS a home-screen PWA is frozen and resumed rather than genuinely relaunched, so Safari's built-in service-worker update check rarely fires. Result: the phone keeps running an old build for days, and the current workaround (delete the icon → re-add to home screen) is dangerous — deleting the icon can drop the origin's IndexedDB, which holds every imported song, playlist, and star (src/lib/db.js, audioBlobs store).
Fix (implemented on branch claude/phone-app-auto-update-xgckp7)
src/lib/pwa.js: registers the SW via virtual:pwa-register and calls registration.update() on every return to foreground (visibilitychange → visible) plus hourly while open. With autoUpdate, a detected new build activates and reloads on its own.
src/main.jsx: calls requestPersistentStorage() at startup (previously only on import) so iOS is asked to mark the library durable every launch.
- Hidden version readout to confirm updates actually land: long-press the tab bar → small pill with
build <commit> · <date> <time> (stamped at build time via a Vite define), auto-hides after 5 s. Invisible in normal use.
Remaining work
Acceptance criteria
A new deploy is running on the phone within one open→close→open cycle, with zero manual steps and zero data loss.
Problem
The app is configured with
registerType: 'autoUpdate'(vite.config.js), but on iOS a home-screen PWA is frozen and resumed rather than genuinely relaunched, so Safari's built-in service-worker update check rarely fires. Result: the phone keeps running an old build for days, and the current workaround (delete the icon → re-add to home screen) is dangerous — deleting the icon can drop the origin's IndexedDB, which holds every imported song, playlist, and star (src/lib/db.js,audioBlobsstore).Fix (implemented on branch
claude/phone-app-auto-update-xgckp7)src/lib/pwa.js: registers the SW viavirtual:pwa-registerand callsregistration.update()on every return to foreground (visibilitychange→visible) plus hourly while open. WithautoUpdate, a detected new build activates and reloads on its own.src/main.jsx: callsrequestPersistentStorage()at startup (previously only on import) so iOS is asked to mark the library durable every launch.build <commit> · <date> <time>(stamped at build time via a Vitedefine), auto-hides after 5 s. Invisible in normal use.Remaining work
npm run deploy:sparky)skipWaitingexplicitlyAcceptance criteria
A new deploy is running on the phone within one open→close→open cycle, with zero manual steps and zero data loss.