Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
PR Checklist
What is the current behavior?
After a native back,
PageRouterOutletfires a popstate from the page'snavigatedFromhandler and the Router handles it in asetTimeout. The previous page already accepts taps in that gap. ARouterExtensions.navigate()from a tap runs first, then the deferred popstate navigates away from the page that was just opened and pushes a new copy of the previous page.What is the new behavior?
NSLocationStrategy.callPopState()keeps a promise that resolves in asetTimeoutscheduled after the popstate callbacks, so after the Router's. While it is pending,RouterExtensions.navigate()andnavigateByUrl()wait for it, so the back is applied before the new navigation.nsRouterLinknavigates throughRouterExtensionsand is covered too. Without a pending popstate both call the Router right away as before.Verified with the same change applied as a runtime patch in a production app (
@nativescript/angular18.0.1) on the iOS simulator: an automated flow that taps a list item right after going back ended on a new copy of the list in 2 of 3 runs before, and on the tapped page in 6 of 6 runs after. In 2 of those runs the tap landed before the popstate and the navigation waited for it.Fixes #185.