Skip to content

feat: Implement strict trace continuation#1166

Draft
antonis wants to merge 3 commits intomainfrom
feat/strict-trace-continuation
Draft

feat: Implement strict trace continuation#1166
antonis wants to merge 3 commits intomainfrom
feat/strict-trace-continuation

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Mar 17, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Expose strictTraceContinuation and orgId options in the Capacitor SDK types (BaseCapacitorOptions), and add them to the FilterNativeOptions whitelist so they pass through to native SDKs.

The underlying implementation is provided by @sentry/core 10.40.0 which already includes the feature. No changes needed in sdk.ts since options naturally flow through via spread operators.

Changes:

  • src/options.ts — Added strictTraceContinuation (boolean) and orgId (string/number) to BaseCapacitorOptions
  • src/nativeOptions.ts — Added options to FilterNativeOptions whitelist
  • test/sdk.test.ts — Added tests verifying options pass through to browser SDK init
  • test/nativeOptions.test.ts — Added test verifying options pass through FilterNativeOptions

💡 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?

  • All 208 tests pass, including new tests for option pass-through and FilterNativeOptions

📝 Checklist

🔮 Next steps

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) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

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


New Features ✨

  • Implement strict trace continuation by antonis in #1166

Internal Changes 🔧

Deps

  • Bump actions/checkout from 4.2.2 to 6.0.2 by dependabot in #1101
  • Bump actions/download-artifact from 4 to 8 by dependabot in #1137
  • Bump immutable from 4.3.6 to 4.3.8 in /example/ionic-angular-v6 by dependabot in #1142
  • Bump @angular/core from 21.0.8 to 21.1.6 in /example/ionic-angular-v8 by dependabot in #1143
  • Bump actions/stale from 10.1.0 to 10.2.0 by dependabot in #1130
  • Bump immutable from 5.1.4 to 5.1.5 in /example/ionic-angular-v8 by dependabot in #1141
  • Bump express-rate-limit from 8.2.1 to 8.3.0 in /example/ionic-angular-v8 by dependabot in #1145
  • Bump tar from 7.5.9 to 7.5.10 in /example/ionic-vue3 by dependabot in #1144
  • Bump hono from 4.12.3 to 4.12.5 in /example/ionic-angular-v8 by dependabot in #1139
  • Bump @hono/node-server from 1.19.9 to 1.19.10 in /example/ionic-angular-v8 by dependabot in #1140
  • Bump immutable from 4.3.7 to 4.3.8 in /example/ionic-angular-v7 by dependabot in #1146
  • Bump actions/setup-node from 6.2.0 to 6.3.0 by dependabot in #1148
  • Bump getsentry/craft from 2.20.1 to 2.23.2 by dependabot in #1149
  • Bump basic-ftp from 5.0.5 to 5.2.0 in /example/ionic-angular-v8 by dependabot in #1133
  • Bump rollup from 4.40.2 to 4.59.0 in /example/ionic-vue3 by dependabot in #1135
  • Bump hono from 4.12.0 to 4.12.3 in /example/ionic-angular-v8 by dependabot in #1136
  • Bump tar from 7.5.7 to 7.5.9 in /example/ionic-vue3 by dependabot in #1127
  • Bump systeminformation from 5.30.7 to 5.31.1 in /example/ionic-vue3 by dependabot in #1126
  • Bump qs from 6.14.1 to 6.14.2 in /example/ionic-vue3 by dependabot in #1128
  • Bump hono from 4.11.9 to 4.12.0 in /example/ionic-angular-v8 by dependabot in #1129

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against f01d4ab

@antonis
Copy link
Contributor Author

antonis commented Mar 17, 2026

@sentry review

@antonis
Copy link
Contributor Author

antonis commented Mar 17, 2026

@cursor review

Copy link
Contributor Author

@antonis antonis left a comment

Choose a reason for hiding this comment

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

@lucas-zimerman Noting that this is fully AI implementation of Strict Trace Continuation for mobile SDK using the feature implementation skill

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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.
@antonis antonis marked this pull request as ready for review March 17, 2026 14:23
@antonis antonis requested a review from lucas-zimerman as a code owner March 17, 2026 14:23
@lucas-zimerman
Copy link
Collaborator

@lucas-zimerman Noting that this is fully AI implementation of Strict Trace Continuation for mobile SDK using the feature implementation skill

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.

@antonis
Copy link
Contributor Author

antonis commented Mar 17, 2026

The JS Side is looking good, but we are not setting these values on the Native options on the Native code.

Good point @lucas-zimerman 👍 I'll convert this back to draft and mark as blocked till the native PRs land:

@antonis antonis marked this pull request as draft March 17, 2026 14:53
@lucas-zimerman
Copy link
Collaborator

oh I see, didnt know they weren't implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants