Skip to content
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

fix: catch service worker unregistration rejection #537

Merged
merged 1 commit into from
Mar 24, 2021
Merged

Conversation

mediremi
Copy link
Contributor

@mediremi mediremi requested a review from Mohammer5 March 17, 2021 14:42
@Mohammer5 Mohammer5 requested a review from amcgee March 17, 2021 14:44
Copy link
Contributor

@Mohammer5 Mohammer5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now logging all error.
Maybe it makes sense to only prevent the unhandled rejection for the specific error (and maybe only in development mode)?

Copy link
Member

@amcgee amcgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to catch all promise rejections here, we can fine-tune the error message or handling for different errors in the future.

I'm not sure this is the linked issue, actually - this error also happens when a serviceworker is registered on localhost - but it's not clear why it's happening here. In any case, it shouldn't hurt to catch rejections.

@Mohammer5
Copy link
Contributor

@amcgee can be reproduced by switching between before- & after-platform-upgrade commits/branches with Firefox and the setting that cookies should be deleted when closing the browser

@mediremi mediremi merged commit e1cbf3e into master Mar 24, 2021
@mediremi mediremi deleted the fix/LIBS-155 branch March 24, 2021 13:59
dhis2-bot added a commit that referenced this pull request Mar 24, 2021
## [6.0.1](v6.0.0...v6.0.1) (2021-03-24)

### Bug Fixes

* catch service worker unregistration rejection ([#537](#537)) ([e1cbf3e](e1cbf3e))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants