Skip to content

fix(core): Send linked errors before the captured error - #7181

Closed
alwx wants to merge 3 commits into
mainfrom
alwx/bugfix/7178
Closed

alwx wants to merge 3 commits into
mainfrom
alwx/bugfix/7178

Conversation

@alwx

@alwx alwx commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix

📜 Description

nativeLinkedErrorsIntegration now puts the linked errors before the captured error in event.exception.values, oldest first. This matches linkedErrorsIntegration in the browser SDK. The same order applies to Java and Objective-C causes and to nativeStackAndroid.

💡 Motivation and Context

Sentry uses the last exception in values for the issue title. Because the integration added the causes at the end, the deepest cause became the title, not the captured error. Fixes #7178.

Issues for errors with a cause may regroup, because the order is part of the grouping hash. The CHANGELOG entry says this.

💚 How did you test it?

I updated the 4 existing nativelinkederrors tests to expect the new order and added a test for a chain of three errors. Without the fix, 5 of the 6 tests fail.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking changes.

🔮 Next steps

A follow-up can set mechanism.exception_id and parent_id, as the browser SDK does, so the Sentry UI shows the chain.

alwx added 2 commits December 4, 2026 11:10
nativeLinkedErrorsIntegration added the linked errors after the captured
error in event.exception.values. Sentry reads chained exceptions oldest
first and uses the last one for the issue title. Because of this, the
deepest cause became the title, not the error that the app captured.

The integration now reverses the collected chain and puts it before the
captured error. This matches linkedErrorsIntegration in the browser SDK.
The change also applies to Java and Objective-C causes and to the
nativeStackAndroid exception.

The order is part of the grouping hash, so issues for errors with a cause
may regroup. The CHANGELOG entry tells users about this.

Fixes #7178
Replace the PR_NUMBER placeholder with the number of PR #7181.
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(core): Send linked errors before the captured error by alwx in #7181
  • chore(deps): update CLI to v4.0.1 by github-actions in #7180
  • feat(core): Use the Sentry CLI v4, with a v3 fallback by BYK and antonis with sentry-junior in #7177
  • chore(deps): update Wizard to v9.2.0 by github-actions in #7176

🤖 This preview updates automatically when you update the PR.

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 221b14c.

Main concerns: data sent to Sentry, reach.

This label is a hint for reviewers, not an approval.

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 221b14c

@alwx
alwx marked this pull request as ready for review December 4, 2026 10:47
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 4, 2026

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@alwx this should already be covered by #7179. I've verified and approved that but leaving the final merge decision to you. Let me know if you want to proceed with this PR instead 🙇

@alwx

alwx commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

@antonis ok, I merged #7179 simply because if was submitted before I did my PR (my bad for not noticing it)

@alwx alwx closed this Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nativeLinkedErrorsIntegration appends linked errors after the original exception, so the cause becomes the issue title

2 participants