Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Service worker should unregister itself on js uncaught exception #144

Open
cdlewis opened this issue Mar 20, 2019 · 1 comment
Open

Service worker should unregister itself on js uncaught exception #144

cdlewis opened this issue Mar 20, 2019 · 1 comment

Comments

@cdlewis
Copy link

cdlewis commented Mar 20, 2019

I think it would be helpful to have the service worker attempt to unregister itself if there's a JS error. Helps stop people from shooting themselves in the foot. I'm open to taking this assuming it's possible / you agree it would be helpful.

@angus-c
Copy link
Contributor

angus-c commented Mar 26, 2019

There's already a try/catch around fetch. Currently that will delete the cache. I could also send a post message to the client which will trigger an unregister, but it would re-register on next page load. I think that's a good balance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants