fix(core): [Session based Traces for Mobile 2] Keep transaction baggage mutable#5402
Draft
adinauer wants to merge 1 commit into
Draft
Conversation
Copying session trace baggage for a transaction now creates mutable baggage so the transaction can populate DSC fields even if the ambient session baggage was already frozen by an earlier outgoing request. Co-Authored-By: Claude <noreply@anthropic.com>
📲 Install BuildsAndroid
|
This was referenced May 11, 2026
Contributor
Performance metrics 🚀
|
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.
PR Stack (Session based Traces for Mobile)
📜 Description
Keeps transaction baggage mutable when remapping a root transaction onto the current session trace. This lets each transaction populate its own DSC fields even if the ambient session propagation baggage was already frozen by an earlier outgoing request without an active transaction.
Adds regression coverage for:
💡 Motivation and Context
Session trace lifecycle can freeze ambient scope baggage before any transaction starts. If a later transaction reuses that frozen baggage directly, outgoing transaction propagation can miss transaction-specific DSC such as
sentry-transaction,sentry-sampled,sentry-sample_rate, andsentry-sample_rand.This keeps the session trace id and sample rand while allowing each remapped transaction to complete its own outgoing baggage.
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry:test --tests 'io.sentry.BaggageTest' --tests 'io.sentry.ScopesTest.session trace transaction baggage is populated after scope baggage is frozen'📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue the Session based Traces for Mobile stack.
#skip-changelog