8000 fix(pwa): install overlay no longer hangs on repeat visits by johannboehme · Pull Request #3 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

fix(pwa): install overlay no longer hangs on repeat visits - #3

Merged
johannboehme merged 1 commit into
mainfrom
claude/elated-wilson-7a5bbc
May 1, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/elated-wilson-7a5bbc

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

useRegisterSW's offlineReady flag only fires on the very first SW install. On any later visit where controller is briefly null at mount (shift-reload, fresh tab before the existing SW claims the client) the overlay would lock open until the user manually reloaded the page.

Hide the overlay also when the SW is otherwise observably ready: navigator.serviceWorker.ready resolving with an active registration, or a controllerchange event landing a controller. Both signals fire on the repeat-visit path that offlineReady misses.

Adds two regression tests covering the ready / controllerchange paths and keeps the existing six tests untouched in semantics.

`useRegisterSW`'s `offlineReady` flag only fires on the very first SW
install. On any later visit where `controller` is briefly null at mount
(shift-reload, fresh tab before the existing SW claims the client) the
overlay would lock open until the user manually reloaded the page.

Hide the overlay also when the SW is otherwise observably ready:
`navigator.serviceWorker.ready` resolving with an active registration,
or a `controllerchange` event landing a controller. Both signals fire
on the repeat-visit path that `offlineReady` misses.

Adds two regression tests covering the ready / controllerchange paths
and keeps the existing six tests untouched in semantics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@johannboehme
johannboehme merged commit 708b4bf into main May 1, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/elated-wilson-7a5bbc branch May 1, 2026 16:00
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.

1 participant

0