-
Notifications
You must be signed in to change notification settings - Fork 17
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
Realtime update #2
Comments
This is a nice idea, I'm not 100% familiar when ServiceWorkers rerequests the service worker file. From my experience, Android does seem to rerequest the service worker on PWA (add-to-homescreen) Apps once you reopen them. I'm not 100% sure on this one thought. Once a new tab with the App is opened, outdated tabs should definitely get the notification. Would be interesting to implement a strategy that periodically checks the service worker file or even via push notification (I don't have any experience with ServiceWorker push features, I think they would need some kind of external service like Google?). Do you think that it would be enough to implement an API to trigger the notification of this addon and implement the check for updates in a additional one? |
I think having a way to maybe check for an update once every 10 minutes would be really cool. |
@NullVoxPopuli you should be easily able to do this without any addons or APIs. To check for an update all you need to do is: navigator.serviceWorker.getRegistration().then(registration => registration.update()); |
so, this is probably my lack of understanding of this addon and service workers in general, but setInterval(() => {
navigator.serviceWorker.getRegistration()
.then(registration => registration && registration.update());
}, 60000); to the application route's activate hook. I only ever see the update notification appear immediately after clicking refresh (but right before the page actually refreshes) |
Hopefully #3 resolves this |
Service workers install in realtime (I think), so this update should be realtime as well.
This will urge users to not work with a outdated app and prevent errors/bugs.
The text was updated successfully, but these errors were encountered: