feat: Implement strict trace continuation#1166
Conversation
Expose `strictTraceContinuation` and `orgId` options in the Capacitor SDK. These options pass through to @sentry/core which handles the actual trace continuation validation logic. Spec: https://develop.sentry.dev/sdk/foundations/trace-propagation/#strict-trace-continuation Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
|
|
@sentry review |
|
@cursor review |
There was a problem hiding this comment.
@lucas-zimerman Noting that this is fully AI implementation of Strict Trace Continuation for mobile SDK using the feature implementation skill
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Address Cursor Bugbot feedback: the options were not included in the FilterNativeOptions whitelist, so they would be silently dropped on native platforms.
The JS Side is looking good, but we are not setting these values on the Native options on the Native code. We will need this https://github.com/getsentry/sentry-react-native/pull/5829/changes#diff-7af7f42daf65903fec96e896fc2518a5422f8545b9bc70c9e512e4da060a589dR145-R154 and this https://github.com/getsentry/sentry-react-native/pull/5829/changes#diff-90d9676a679f04d29edee62e5422c73f60a04ad890ab1d13191826912466e9d4R100-R112 in order for this PR to be functional. |
Good point @lucas-zimerman 👍 I'll convert this back to draft and mark as blocked till the native PRs land: |
|
oh I see, didnt know they weren't implemented yet. |
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
…tinuation # Conflicts: # CHANGELOG.md
|
Status update: Reopened (was auto-closed by stale bot), merged latest main and resolved changelog conflict. The JS-layer implementation works today via To deliver the full functionality, the native SDK dependencies need to be bumped so that the options take effect on the native side:
|
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
|
Let's keep this open. We will resume work on it once we update to the latest Cocoa and Android. |
|
@lucas-zimerman @antonis will this be included in the next release? :) |
The native SDK bumps that would unblock this PR are approved and ready to be merged:
As soon as this happens I'll update the implementation on this PR and we can include it in the next release. |
Merges latest main which includes Android SDK 8.41.0 and Cocoa SDK 9.13.0 version bumps that include strict trace continuation support in native SDKs. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The options were being passed through FilterNativeOptions to the bridge but not mapped to the native SDK options on Android and iOS. Aligned with sentry-react-native implementation (PR #5829). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verify that strictTraceContinuation and orgId options pass through the native bridge via initNativeSdk, aligned with RN wrapper tests. Co-Authored-By: Claude Opus 4.6 <[email protected]>
antonis
left a comment
There was a problem hiding this comment.
@lucas-zimerman Ready for another check now that the native side is wired up 🙇

📢 Type of change
📜 Description
Expose
strictTraceContinuationandorgIdoptions in the Capacitor SDK types (BaseCapacitorOptions), and add them to theFilterNativeOptionswhitelist so they pass through to native SDKs.The underlying implementation is provided by
@sentry/core10.40.0 which already includes the feature. No changes needed insdk.tssince options naturally flow through via spread operators.Changes:
src/options.ts— AddedstrictTraceContinuation(boolean) andorgId(string/number) toBaseCapacitorOptionssrc/nativeOptions.ts— Added options toFilterNativeOptionswhitelisttest/sdk.test.ts— Added tests verifying options pass through to browser SDK inittest/nativeOptions.test.ts— Added test verifying options pass throughFilterNativeOptionsNative SDK support:
💡 Motivation and Context
Implements Strict Trace Continuation spec. Prevents cross-org trace continuation by validating org IDs in distributed traces.
Part of the Strict Trace Continuation initiative.
💚 How did you test it?
FilterNativeOptions📝 Checklist
sendDefaultPIIis enabled🔮 Next steps