fix: Fix unhandled promise rejections not being tracked #1367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Because of a version mismatch in the Promise version used in
react-native
andfbjs
the promise patching we perform is patching the incorrect one, so the hacky fix is to overwrite global promise's methods (if they exist).sentry-react-native/src/js/integrations/reactnativeerrorhandlers.ts
Lines 90 to 105 in b1de06b
💡 Motivation and Context
Fixes #1077
💚 How did you test it?
Added a new e2e test for unhandled promise rejections. Ran iOS locally but please wait for it to run CI on this PR to confirm.
📝 Checklist
🔮 Next steps
We should add a matrix to our e2e CI to test on multiple react native versions as although the code block shown in the description is very defensive to prevent issues, we should still have a way to make sure.