Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service worker onUpdate not triggering if page load was interrupted #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheRusskiy
Copy link

We need to handle the case when a page is loaded and a service worker is already "waiting".

To me this happens randomly when you least expect, but one way to reproduce this issue is to open the page,
see that service worker is beginning to download and close / reload the page.

It seems that Chrome finishes the SW load even if you close the page. In this case on the next page load it's waiting and not installing, which means the
registration.waiting.postMessage({ type: "SKIP_WAITING" }) trick won't work.

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.

None yet

2 participants