Repository navigation
feat(sample): [Nav3 Lifecycle 5] Add Nav3 lifecycle scenarios to sample app - #6309
Conversation
|
📲 Install BuildsAndroid
|
7039fb1 to
8530b8d
Compare
f24236a to
810739e
Compare
8530b8d to
8fefcab
Compare
3f72d2a to
fbef142
Compare
8fefcab to
604ace1
Compare
fbef142 to
b306729
Compare
604ace1 to
bfd5a9f
Compare
bfd5a9f to
4b32d48
Compare
b306729 to
efc6686
Compare
4b32d48 to
b86ffdb
Compare
b86ffdb to
253cdc2
Compare
Add runnable multi-Activity and multi-Fragment Navigation 3 scenarios with shared transaction history so lifecycle handoffs can be exercised in the Android sample.\n\nRefs JAVA-274
Crash only after the first Checkout composition is applied so the navigation transaction and scenario tags are available for attribution. Apply the scenario tag directly to the scope transaction to keep history filtering robust. Refs JAVA-274 Co-Authored-By: OpenAI Codex <noreply@openai.com>
Coordinator methods run inside IScopes.configureScope, which already catches anything a scope call throws. Replace the try/finally blocks in unregisterCandidate and transferLeaseTo with ordering: update the coordinator's bookkeeping before calling into the scope, so it stays consistent if a scope call throws.
4d56945 to
8c65675
Compare
Prevent covered Navigation 3 roots from retagging the transaction owned by the current leaseholder. Preserve initial Activity UI-load tagging and cover both ownership paths with regression tests. Refs JAVA-785 Co-Authored-By: OpenAI Codex <noreply@openai.com>
e495908
into
feat/sentry-nav-effect-lifecycle
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 91d6d32. Configure here.
| activeTransaction.setTag(NAV3_SCENARIO_TAG, scenario.label) | ||
| activeTransaction.setTag(NAVIGATION_SAMPLE_SCENARIO_TAG, scenario.label) | ||
| activeTransaction.setTag(NAVIGATION_SAMPLE_ACTIVITY_TAG, hostName) | ||
| activeTransaction.setTag(NAVIGATION_SAMPLE_SESSION_TAG, sessionId) |
There was a problem hiding this comment.
Covered roots can retag transactions
Medium Severity
The new ownership check treats a matching /${route.routeName} as proof this root owns the current transaction. A covered root that stays composed (ViewPager neighbor, paused Activity) still reruns this SideEffect on recomposition, and if it happens to show the same destination it overwrites sample_navigation_activity on the leaseholder's transaction.
Reviewed by Cursor Bugbot for commit 91d6d32. Configure here.
| activeTransaction.getTag(NAVIGATION_SAMPLE_ACTIVITY_TAG) == null | ||
| if (!ownsNavigationTransaction && !ownsUiLoadTransaction) { | ||
| return | ||
| } |
There was a problem hiding this comment.
Custom transactions drop from history
Low Severity
tagNavigationSampleTransaction now returns unless the scope transaction is this route's nav transaction or an untagged ui.load. Custom-scenario transactions use names like custom.productlist_screen, so they no longer receive sample_navigation_session and the history listener drops them.
Reviewed by Cursor Bugbot for commit 91d6d32. Configure here.


PR Stack (Nav3 Lifecycle)
📜 Description
Add runnable Navigation 3 sample flows for applications with multiple Activities and multiple Fragments, each hosting its own
SentryNavEffect.The sample records a shared navigation transaction history, labels transactions by Activity, and provides scenarios for Activity handoffs, Fragment replacement, dialogs, and ViewPager pages.
💡 Motivation and Context
These scenarios make the lifecycle behavior introduced by the stack directly observable and provide a practical harness for manual verification and future debugging.
addresses: JAVA-785
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Merge the stack from Part 1 through Part 5 using merge commits, then squash-merge the collection PR into
main.#skip-changelog