-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Sometimes the ServiceWorker ends up in a state where it does not handle anything more, even if it's registered and enabled #145
Comments
It's still unstable for now (see #145). If the user confirms he wants to use this mode, a cookie is set, so that he is not warned again in the next 24 hours
After some debugging, it seems to come from the fact that the service worker has been stopped by the browser (after some inactivity). |
Re-sending the 'init' message to the ServiceWorker makes everything work again. Because it sets the MessageChannel. It can be done from the UI by selecting the jQuery mode, then switching again to the ServiceWorker mode. So I don't see any other way than sending periodically the 'init' message (or creating a dedicated type of message), to maintain the state of the ServiceWorker. |
…riodically. The MessageChannel is re-created each time. It prevents the ServiceWorker from being restarted and losing its variables See #145
I just wanted to report that as of the Windows 10 April 2018 update, Edge now ships with Service Worker switched on, no special flags needed. As with Chromium, it only works with the http:// protocol, not with file:// protocol, so it needs a local server, which is a shame. I've been testing it, and it works very well for the most part, and is snappy. Issues experienced seem to be those described in this issue, broadly. If I "refresh" the browser page, to reload code, then the Service Worker stops working, until I've manually disabled it and re-enabled it again. I experienced exactly the same issue on Chromium, so it is not browser-specific. If I exit the browser completely, relaunch it and go back to http://localhost, even though both channels are shown as green, the Service Worker doesn't load CSS etc. until I manually disable it and re-enable it (I also experienced this with Chromium). I have not yet used it long enough to notice it disabling itself mid-session, as reported above. |
…riodically. The MessageChannel is re-created each time. It prevents the ServiceWorker from being restarted and losing its variables See #145
…riodically. The MessageChannel is re-created each time. It prevents the ServiceWorker from being restarted and losing its variables See #145
I found a last use-case where this can happen : the user is in SW mode, then switches to jQuery mode, then switches back to SW mode. |
This stucks the application.
I saw that both on Chromium and Firefox dev edition.
Workaround : remove manually the ServiceWorker and reload
The text was updated successfully, but these errors were encountered: