-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update mechanisms #26
Comments
related: #96 (comment) |
Currently, once a SW is registered on the subdomain, the subdomain SW never gets an update unless the user explicitly deletes it. see #96 for catching sw-only-asset requests |
Based on the following docs, the browser checks for byte changes to the SW script on "navigation to an in-scope page.", but I'm not sure what's exactly meant by "in-scope page". Does that mean that every time Also somewhat relevant for this: https://stackoverflow.com/questions/33986976/how-can-i-remove-a-buggy-service-worker-or-implement-a-kill-switch/38980776#38980776 |
it means that every service worker is registered to a scope. For our usecase: an origin. But it can also be an origin+path for service workers in general.
the browser checks for changes after 24 hours or .. other things. But we have code in the UI that will automatically update the SW. The problem is, on subdomains, the UI is never rendered (currently) beyond the |
I don't like the idea of A if we have C, but I can implement A and C, Both will use some version of this function: async function deregister() {
self.registration.unregister()
.then(function() {
return self.clients.matchAll();
})
.then(function(clients) {
clients.forEach(client => client.navigate(client.url))
});
} A details:on install: Add a timestamp to existing config-db. C details
|
Need
At some point we may want to not reload worker on every page load(?).
We may have a bug which breaks all websites, there may be an important update, or user wants to ensure they have the latest version.
We need reliable mechanisms for forcing reload of SW code.
Implementation ideas
Below are my initial ideas, feedback welcome.
I think at minimum, at least short term, we need (A) and (C).
Global:
/ipns/inbrowser.link/sw-version
on sw init, and if set to timestamp/version higher than one in sw code, we force-reload sw to new version.Per user:
?sw-update
param, allows end user to manually force reloadServiceWorkerRegistration.onupdatefound
it on root domain to softly inform user new version is available, and button they could click to update + have cookie that then informs all subdomains to update as well.The text was updated successfully, but these errors were encountered: