Repository navigation
fix(pwa): install overlay can no longer hang the app indefinitely - #5
Merged
Merged
Conversation
In dev mode the SW plugin is disabled, so `offlineReady` never flips true and the overlay gated the UI forever — reloading didn't help, each reload restarted the same dead wait. The same trap exists in prod if the SW genuinely fails to register. Three independent ways out now: - `disabled` option on the hook; the overlay passes `import.meta.env.DEV` so dev never gates. - `maxWaitMs` hard timeout (default 120 s) auto-dismisses if SW doesn't finish — the SW continues caching in the background, so losing the overlay does not lose the install. - Existing happy path (`offlineReady → visible: false`) unchanged. Also translated the German strings on the overlay to English for consistency with the rest of the UI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
johannboehme
force-pushed
the
claude/fervent-proskuriakova-8dfd63
branch
from
May 1, 2026 18:54
f559f77 to
e0f608b
Compare
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
Layered on top of #3, which already addressed the repeat-visit case (
sw.ready+controllerchangelifecycle hooks). This PR adds the cases #3 doesn't cover:vite-plugin-pwahasdevOptions.enabled: false, so no SW gets registered.sw.readynever resolves,controllerchangenever fires,offlineReadynever flips — the overlay would gate the UI forever on every dev visit. TheInstallProgressOverlaynow passesdisabled: import.meta.env.DEV, skipping the overlay entirely in dev.maxWaitMshard timeout (default 120 s) auto-dismisses the overlay if all the lifecycle signals fail to fire — e.g. SW registration crashing in a way the browser doesn't surface as a controller event. The SW continues caching in the background, so losing the overlay doesn't lose the install. The 90 s slow-mode warning still shows first; the user gets ~30 s to read it before the hard dismiss.After this lands, three independent ways the overlay closes:
offlineReadyflips, orsw.ready/controllerchangefires — both from fix(pwa): install overlay no longer hangs on repeat visits #3)Test plan
vitest run --project=unit src/pwa— 19/19 passing (10 inuseInstallProgress.test.ts: 6 pre-existing + 2 from fix(pwa): install overlay no longer hangs on repeat visits #3 coveringsw.ready/controllerchange, plus 2 new ones formaxWaitMsauto-dismiss anddisabled: true)tsc --noEmit— clean🤖 Generated with Claude Code