Auto-update the installed Home Screen app (Android + iOS) - #10
Merged
Conversation
- SW install now fetches the shell with cache:"reload" so a new worker always stores the freshly deployed files - Page reloads once when a new SW takes control (guarded: never loops, never on first install) so the installed PWA shows the latest build automatically - Re-checks for updates on load, on foreground/visibility, and hourly - sw cache -> v7 https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the installed Home Screen app (Android + iOS PWA) automatically pick up new deploys instead of serving stale cached content.
cache:"reload", so a new service worker always stores the freshly deployed HTML/JS/CSS (bypasses the HTTP cache). Combined with the existingskipWaiting()+clients.claim()+ old-cache cleanup, a new version fully takes over.swRefreshingflag and ahadControllercheck → never loops, never reloads on first install.registration.update()runs on load, again whenever the app is foregrounded (visibilitychange— installed PWAs resume from background without a navigation), and hourly while open.swcache → v7.How it behaves
Deploy → user opens the Home Screen app (or it resumes) → SW update detected → new shell cached fresh → new SW activates → page auto-reloads once → latest version shown. No manual reinstall.
Test plan
https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Generated by Claude Code