Skip to content

feat: Implement strict trace continuation#1166

Open
antonis wants to merge 7 commits into
mainfrom
feat/strict-trace-continuation
Open

feat: Implement strict trace continuation#1166
antonis wants to merge 7 commits into
mainfrom
feat/strict-trace-continuation

Conversation

@antonis
Copy link
Copy Markdown
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

Native SDK support:

  • Android SDK 8.41.0 — includes strict trace continuation support
  • Cocoa SDK 9.13.0 — includes strict trace continuation 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?

  • All 206 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) <[email protected]>
@github-actions
Copy link
Copy Markdown
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

Bug Fixes 🐛

  • (android) AGP 9.0 no longer supports proguard-android.txt by jb3rndt in #1196

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
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 607ecf7

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Mar 17, 2026

@sentry review

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Mar 17, 2026

@cursor review

Copy link
Copy Markdown
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
Copy Markdown

@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.

Comment thread test/sdk.test.ts Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

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 Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Apr 16, 2026

Status update: Reopened (was auto-closed by stale bot), merged latest main and resolved changelog conflict.

The JS-layer implementation works today via @sentry/core 10.43.0 which already includes strict trace continuation. This PR exposes the options in Capacitor types and adds them to the FilterNativeOptions whitelist.

To deliver the full functionality, the native SDK dependencies need to be bumped so that the options take effect on the native side:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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 Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented May 8, 2026

Let's keep this open. We will resume work on it once we update to the latest Cocoa and Android.

@christophaigner
Copy link
Copy Markdown
Member

@lucas-zimerman @antonis will this be included in the next release? :)

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented May 18, 2026

@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]>
antonis and others added 2 commits May 19, 2026 09:54
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]>
Copy link
Copy Markdown
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 Ready for another check now that the native side is wired up 🙇

@antonis antonis marked this pull request as ready for review May 19, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants