-
Notifications
You must be signed in to change notification settings - Fork 63
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
Prevent refresh on server update #147
Comments
I cannot reproduce this, do you have a reproduction for this. The skipWaiting definitely won't cause a browser refresh. There must be other forces at work. Can you help us to some steps to reproduce this behaviour? |
This happened when the app was at a bare minimum. It doesn't happen anymore. I've been stripping away elements to try to recreate the issue but it doesn't happen again. It happened with 3 Android phones, when we all tested the PWA from a live server for the first time. When on a page that auto-plays radio - e.g. https://amp.lol/GqO_E1JaK - and stop was clicked, publising a new version to the server caused all phones - even with two minutes delay the one that had the screen off - to start playing music again. In other words, the page was refreshed. The problem in debugging the cause of this is that I don't know precisely what the lifecycles of service workers and PWAs are. Usually with a better understanding, I am better capable of finding the culprit. We tested installing and running the PWA in production mode shortly after deploying a version with the following modules installed:
How does the service worker update when a new version exists anyway? Does it poll? |
I've installed the ember-service-worker and co plugins basically to allow PWA capabilities, but I'm not actually running custom code yet.
However, with the website installed as PWA, every time there is an update to the Ember app on the server, the page refreshes for everyone who has the PWA open. EVERYONE.
https://youtu.be/74BzSTQCl_c?t=10
How do I prevent this? Where do I listen to the
install
event and prevent anything from refreshing? Or show a dialog asking the user to refresh now or later?The refresh is probably caused by this (not sure):
ember-service-worker/lib/index-file.js
Lines 25 to 27 in c6a9fb4
I think the
skipWaiting()
defaults are undocumented.The text was updated successfully, but these errors were encountered: