You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
Navigating between sibling routes may sometimes mess with the cache due to it using the key of a parent route, instead of the complete route.
What is the new behavior?
This now uses the correct key from the farthest children of the route
PARTIALLY Fixes#1993. (this issue has 2 problems on it: 1 is the one fixed in this PR, the other is that route guard/resolvers don't work on back navigation and may break navigation for a PRO)
@edusperoni@NathanaelA
When debugging this issue in the use case Root => A => B, then back to A it looks like all keys to store/retrieve are generated correctly (also without this fix), but the error is still thrown.
The expression that causes the error to be thrown (curr.value.routeConfig !== result.value.routeConfig in https://github.com/angular/angular/blob/3817e5f1dfeb9de26fa2ea4068a37565f435214f/packages/router/src/create_router_state.ts#L52) will actually show equal properties and values when inspecting, but are not the same object reference. This only occurs with lazy loaded modules (if changed to "regular" route configs it works).
Perhaps the solution direction for this part of the issue is to either use a "deepEqual" instead of reference equality or to somehow make sure that the routeConfig reference stays the same for lazy loaded modules.
Hope this helps, cheers.
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
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.
…route
PR Checklist
What is the current behavior?
Navigating between sibling routes may sometimes mess with the cache due to it using the key of a parent route, instead of the complete route.
What is the new behavior?
This now uses the correct key from the farthest children of the route
PARTIALLY Fixes #1993. (this issue has 2 problems on it: 1 is the one fixed in this PR, the other is that route guard/resolvers don't work on back navigation and may break navigation for a PRO)