-
Notifications
You must be signed in to change notification settings - Fork 115
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
SDK auto-update mechanism #266
Comments
Hey @ithinkihaveacat, The current way service workers update is as follows for HTTPS sites:
This isn't the best way to overwrite workers, a hash would be better, but we have some legacy requirements that made this path safer. |
@jasonpang The issue is that the browser might take quite a while to discover that https://cdn.onesignal.com/sdks/OneSignalSDK.js has been updated, because in most cases it will only fetch that resource if/when https://site.com/OneSignalSDKWorker.js changes. (See w3c/ServiceWorker#839 for more information.) If you're not experiencing any problems with old service workers then you don't need to worry about this, but if you want to push workers to update promptly then using hashes somewhere in the dependency graph might be helpful. |
Do you have a system for updating your SDKs? If not, you might want to have a look at https://stackoverflow.com/a/43471531/. (It looks like some identifiers are used to load the JS libraries, but I can't tell if they're per-site or content based, such that they change when the libraries themselves are updated.)
The text was updated successfully, but these errors were encountered: