forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router): fix navigation ignoring logic to compare to the browser url
This PR changes the logic for determining when to skip route processing from using the URL of the last attempted navigation to the actual resulting URL after that transition. Because guards may prevent navigation and reset the browser URL, the raw URL of the previous transition may not match the actual URL of the browser at the end of the navigation process. For that reason, we need to use `urlAfterRedirects` instead. Other notes: These checks in scheduleNavigation were added in angular@eb2ceff The test still passes and, more surprisingly, passes if the checks are removed completely. There have likely been changes to the navigation handling that handle the test in a different way. That said, it still appears to be important to keep the checks there in some capacity because it does affect how many navigation events occur. This addresses an issue that came up in angular#16710: angular#16710 (comment) This also partially addresses angular#13586 in fixing history for imperative navigations that are cancelled by guards.
- Loading branch information
Showing
2 changed files
with
204 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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