Skip to content

Auto-update the installed Home Screen app (Android + iOS) - #10

Merged
CarlosA49 merged 1 commit into
mainfrom
claude/ai-humanizer-tool-DPX66
May 17, 2026
Merged

Auto-update the installed Home Screen app (Android + iOS)#10
CarlosA49 merged 1 commit into
mainfrom
claude/ai-humanizer-tool-DPX66

Conversation

@CarlosA49

Copy link
Copy Markdown
Owner

Summary

Makes the installed Home Screen app (Android + iOS PWA) automatically pick up new deploys instead of serving stale cached content.

  • SW install now fetches every shell file with cache:"reload", so a new service worker always stores the freshly deployed HTML/JS/CSS (bypasses the HTTP cache). Combined with the existing skipWaiting() + clients.claim() + old-cache cleanup, a new version fully takes over.
  • Page side: when a new SW takes control, the page reloads once so the user immediately sees the new build. Guarded with a swRefreshing flag and a hadController check → never loops, never reloads on first install.
  • Update checks: registration.update() runs on load, again whenever the app is foregrounded (visibilitychange — installed PWAs resume from background without a navigation), and hourly while open.
  • Offline still works (cache-first fetch unchanged); sw cache → 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

  • Install to Home Screen (Android Chrome + iOS Safari)
  • Deploy a visible change; reopen the installed app → it updates automatically within a launch (brief one-time reload)
  • First-ever install does NOT cause an extra reload / loop
  • Offline launch still loads the cached app
  • Python tests still pass

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y


Generated by Claude Code

- 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
@CarlosA49
CarlosA49 merged commit 6c8a82b into main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants