Repository navigation
ref(android): Support updates to nav state across multiple SentryNavEffect instances - #6229
Draft
0xadam-brown wants to merge 1 commit into
Draft
0xadam-brown wants to merge 1 commit into
0xadam-brown wants to merge 1 commit into
Conversation
📲 Install BuildsAndroid
|
5 of 9 tasks
0xadam-brown
force-pushed
the
ref/sentry-nav-effect-lifecycle
branch
3 times, most recently
from
October 12, 2026 10:55
011d126 to
eca83dc
Compare
…ffect instances (JAVA-274) Allow separate SentryNavEffect instances to overlap during Activity transitions without stale cleanup clobbering the active observer.
0xadam-brown
force-pushed
the
ref/sentry-nav-effect-lifecycle
branch
from
October 12, 2026 15:31
eca83dc to
72119f1
Compare
This branch has not been deployed
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.
📜 Description
PR allows separate
SentryNavEffectinstances to overlap during Activity transitions without stale cleanup clobbering the active observer.Like all forms of state management around Android lifecycles, this code isn't exactly simple. To keep things manageable (and easy to update!), I've been careful to sequester all state management to the
INavScopesfile.That let me keep updates to
SentryNavEffect,BackStackObserver, etc. to a minimum 🎉 .💡 Motivation and Context
Lets us support multi-Activity apps, where each Activity has its own SentryNavEffect <> NavDisplay pair. That setup is common, and without the changes here, spans and nav state would be incorrect for the initial destination in each newly-launched Activity.
That's worrisome, because Activity startup logic is a common source of bugs / crashes, so properly attributing Sentry data there is especially worthwhile.
addresses: JAVA-274
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
@ApiStatus.Internalannotations from SentryNavEffect, SentryNavOptions, BackStackEntryMapper once we're ready to release publicly + add an appropriate CHANGELOG entry + publish the module via craft (link).#skip-changelog