Repository navigation
feat(android): [Part 4] Prefer Activity ui.load transactions over Nav3 transactions #6484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix/nav3-lifecycle-3-lease-withdrawal
Are you sure you want to change the base?
Changes from all commits
10ee57c
5a98b2a
7033ead
688b4a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,8 @@ internal class NavScopes( | |
| /** This instance's registration with the [coordinator], while it's attached. */ | ||
| private var registration: NavLeaseRegistration? = null | ||
|
|
||
| private val stagedNavTransaction = StagedNavTransaction(delegate) | ||
| private val stagedNavTransaction = | ||
| StagedNavTransaction(delegate, delegate.options.monotonicTicker) | ||
| private val stagedNavData = StagedNavData() | ||
|
|
||
| private val navStatePublisher = NavStatePublisher() | ||
|
|
@@ -154,6 +155,10 @@ internal class NavScopes( | |
| stagedNavTransaction.publishTo(scope) | ||
| } | ||
|
|
||
| override fun retryTransactionPublication(scope: IScope) { | ||
| stagedNavTransaction.retryPublishIfBlocked(scope) | ||
| } | ||
|
|
||
| override fun unpublishFrom(scope: IScope) { | ||
| stagedNavTransaction.unpublishFrom(scope) | ||
| stagedNavData.clearPublishedStateFrom(scope) | ||
|
|
@@ -228,7 +233,9 @@ internal class NavScopes( | |
| override fun startNavTransaction(request: NavTransactionRequest) { | ||
| stagedNavTransaction.stage(request) | ||
| if (hasLease) { | ||
| stagedNavTransaction.publishTo(delegate) | ||
| // Don't retry b/c ui.load retry is only for returns to a nav root, not for navigation | ||
| // within it. | ||
| stagedNavTransaction.publishTo(delegate, canRetry = false) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Return navigation cancels ui.load retryMedium Severity Returning from a covering Activity arms a one-shot Additional Locations (1)Reviewed by Cursor Bugbot for commit 688b4a7. Configure here. |
||
| } else { | ||
| stagedNavData.deferPropagationContextRotation() | ||
| } | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so my agent tells me that this retry isn't completely necessary.
for example, if you go to Activity B from nav screen A and press back quickly enough, the retry blocks A when it resumes
my clanker says it would simplify the code the remove the retry. ill let you decide!