Repository navigation
fix(core): Put native linked errors before the original exception - #7179
Conversation
PR risk: mediumFor commit Main concerns: reach, data sent to Sentry. This label is a hint for reviewers, not an approval. |
|
The changelog-preview failure is not from this change. The workflow does not check out code from fork PRs, so it fails on every fork PR. |
|
@sentry-junior verify |
|
Experimental end-to-end verification by Junior, run on an Android emulator in CI. A maintainer decides what it means. fix(core): Put native linked errors before the original exception: Verified on Android Claim (from #7178): a JS error's
The event links need access to the sentry-sdks org.
Asked by antonis. Run: https://github.com/getsentry/sentry-react-native/actions/runs/47313065547 via Antonis Lilis. |
antonis
left a comment
There was a problem hiding this comment.
LGTM 🚀
Thanks for the fix @lazerg, and for the clear issue write-up 🙇
Verified end to end without and with the change:
| Scenario | Without | With |
|---|---|---|
Error with cause |
Error: Cause of captured exception |
Error: Captured exception |
Sentry.ErrorBoundary |
React ErrorBoundary Invariant Violation: … |
Invariant Violation: … |
nativeStackAndroid rejection |
[JS, Java] |
[Java, JS] |
Together with the CI verification above, this confirms the original exception now stays last in exception.values aligning with the spec.
📢 Type of change
📜 Description
nativeLinkedErrorsIntegrationnow puts the linked errors before the original exception, oldest first, so the original exception stays last inexception.valueslikelinkedErrorsIntegrationin@sentry/coredoes.debugSymbolicatorIntegrationmatched the cause chain toexception.valuesfrom the front, so I changed it to match from the end, otherwise in dev the symbolicated frames would land on the wrong exception.💡 Motivation and Context
Fixes #7178
Sentry treats the last exception in
valuesas the main one. Because the causes were appended after the original exception, an error likenew Error('Request failed', { cause })got the cause's type and message as the issue title.💚 How did you test it?
Added a unit test with a two-level JS
causechain and updated the existing native linked errors and debug symbolicator tests to the new order.yarn jestandyarn lintpass inpackages/core.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps