You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users that import their service worker into ours lose the ability to update their service worker.
The update algorithm of the service worker checks for byte-differences in the service worker's script but it doesn't use the contents of imported scripts (imported via importScript(..)) to be part of that check. This is kind of an issue because it means the service worker will never update if we have two importScript(..) statements. Our workaround for this issue has been to register a new service worker over the existing one, which updates the service worker (we do not unregister the previous one before registering the new one, we only register the new one, as unregistering the previous worker also unsubscribes the user from push notifications). We do not register a new service worker every time for performance reasons; we only register a new service worker anytime the version number of our SDK changes (which is infrequently, but once a week or once every two weeks).
The service worker update behavior is intended to change to also check the contents of imported scripts. See here.
Make OneSignal._updateServiceWorker() public (and remove the _)
Allow it to take a {force: true} parameter
Miscellaneous: Combine usages of OneSignal.VERSION and OneSignal._VERSION
The text was updated successfully, but these errors were encountered:
Users that import their service worker into ours lose the ability to update their service worker.
The update algorithm of the service worker checks for byte-differences in the service worker's script but it doesn't use the contents of imported scripts (imported via importScript(..)) to be part of that check. This is kind of an issue because it means the service worker will never update if we have two importScript(..) statements. Our workaround for this issue has been to register a new service worker over the existing one, which updates the service worker (we do not unregister the previous one before registering the new one, we only register the new one, as unregistering the previous worker also unsubscribes the user from push notifications). We do not register a new service worker every time for performance reasons; we only register a new service worker anytime the version number of our SDK changes (which is infrequently, but once a week or once every two weeks).
The service worker update behavior is intended to change to also check the contents of imported scripts. See here.
OneSignal._updateServiceWorker()
public (and remove the_
){force: true}
parameterOneSignal.VERSION and OneSignal._VERSION
The text was updated successfully, but these errors were encountered: