Repository navigation
fix(tracing): Sync the JS trace to the native SDKs after they start - #7107
Merged
antonis merged 2 commits intoNov 25, 2026
Merged
Conversation
RasmusKard
requested review from
alwx,
antonis and
lucas-zimerman
as code owners
November 24, 2026 19:27
antonis
approved these changes
Nov 25, 2026
antonis
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution @RasmusKard 🙇
The code changes look good and the sample app worked as expected for me with the fix (internal Sentry link) 🎉
3 tasks
3 of 11 tasks
3 tasks done
This was referenced Nov 26, 2026
3 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Native kept its own random trace until the first idle span synced, so native errors and crashes didn't share the JS trace:
inactiveon iOS), sincestartIdleSpanreturns earlyinitNativeSdkfinished was lost, because the native start replaces the scopeNow the client also syncs after native init: the active span, or the scope's propagation context when there is none.
💡 Motivation and Context
I tried sentry-cocoa's
webViewTracing(getsentry/sentry-cocoa#9538) on iOS instead ofsentryWebViewProps, and WebView pages got native's random trace instead of the app's. This was the root cause.Follow-up to #6686 and #6720, which only sync from
startIdleSpan.💚 How did you test it?
sampled: undefineduseNativeInit: before the fix native had a different trace than JS, after it they matchedinitNativeSdkwas lost before the fix and kept after (Android in both setups, iOS withuseNativeInit)📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps