Skip to content

feat: Implement strict trace continuation#1166

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

feat: Implement strict trace continuation#1166
antonis wants to merge 4 commits intomainfrom
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

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

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

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.

2 participants