Skip to content

feat(android): [Nav3 Lifecycle 3] Coordinate SentryNavEffect access to current IScope - #6305

Open
0xadam-brown wants to merge 3 commits into
feat/part-2-sentry-nav-effect-lifecyclefrom
feat/part-3-sentry-nav-effect-lifecycle
Open

0xadam-brown wants to merge 3 commits into
feat/part-2-sentry-nav-effect-lifecyclefrom
feat/part-3-sentry-nav-effect-lifecycle

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Nav3 Lifecycle)


📜 Description

Introduce a new CoordinatedBackStackObserver that lets SentryNavEffect make use of the state coordination code we added to .navigation3.lifecycle.

Each effect now stages nav data through the lease-aware NavScopes layer and only publishes it while its navigation root owns the lease to the shared Sentry IScope.

💡 Motivation and Context

Applications can host more than one Navigation 3 root at a time. Lifecycle coordination prevents an inactive root from clearing or overwriting the active root's navigation state.

addresses: JAVA-274

💚 How did you test it?

  • Unit tests
  • Integration tests (included in a later PR)
  • New Nav3 sample app flows (also in a later PR) + having my clanker perform lots of thorough manual testing

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The next PR adds lifecycle integration coverage for overlapping Activities, Fragments, and ViewPager pages.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Coordinate SentryNavEffect instances through the host lifecycle so overlapping navigation roots safely publish navigation state and tracing data.\n\nRefs JAVA-274
@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

JAVA-274

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 9a50d5d

@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.0 (1) release

⚙️ sentry-android Build Distribution Settings

@0xadam-brown
0xadam-brown marked this pull request as ready for review October 20, 2026 15:31
@0xadam-brown 0xadam-brown added the sanity-check PR needs a lightweight review for obvious issues label Oct 20, 2026
@0xadam-brown 0xadam-brown changed the title feat(android): [Nav3 Lifecycle 3] Coordinate effect lifecycles feat(android): [Nav3 Lifecycle 3] Coordinate SentryNavEffect lifecycles Oct 20, 2026
@0xadam-brown 0xadam-brown changed the title feat(android): [Nav3 Lifecycle 3] Coordinate SentryNavEffect lifecycles feat(android): [Nav3 Lifecycle 3] Coordinate SentryNavEffect access to global IScope Oct 20, 2026
@0xadam-brown 0xadam-brown changed the title feat(android): [Nav3 Lifecycle 3] Coordinate SentryNavEffect access to global IScope feat(android): [Nav3 Lifecycle 3] Coordinate SentryNavEffect access to current IScope Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant