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

Handle failed promise by silently ignoring it #17735

Merged
merged 4 commits into from Jul 5, 2021

Conversation

justinvelluppillai
Copy link
Contributor

Description:

fixes #17454

The setting in firefox to delete cookies when firefox closes causes navigator.serviceWorker.ready to fail and firefox gives the operation is insecure error. This change silences the error by handling the rejected promise with the second argument to the .then() function.

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@justinvelluppillai justinvelluppillai added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jul 5, 2021
@justinvelluppillai justinvelluppillai added this to the 4.4.0 milestone Jul 5, 2021
@justinvelluppillai justinvelluppillai added the Needs Review PRs that need a code review label Jul 5, 2021
@justinvelluppillai justinvelluppillai marked this pull request as ready for review July 5, 2021 03:15
@tsteur
Copy link
Member

tsteur commented Jul 5, 2021

build js

@justinvelluppillai
Copy link
Contributor Author

build js

@justinvelluppillai
Copy link
Contributor Author

To test this open a page with matomo tracking js on it, go offline then back online again (eg turn wifi off/on) and without this change you will see a console error, with this change you shouldn't.

@diosmosis
Copy link
Member

Looks good 👍

@diosmosis diosmosis merged commit b2169df into 4.x-dev Jul 5, 2021
@diosmosis diosmosis deleted the 17454-handle-failed-promise branch July 5, 2021 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS Tracking code may generate "The operation is insecure" warnings with specific Firefox settings
3 participants