Conversation
atscott
force-pushed
the
fix-redirect-after-commit
branch
from
October 1, 2026 19:44
e8cc871 to
5009842
Compare
atscott
force-pushed
the
fix-redirect-after-commit
branch
from
October 1, 2026 19:51
5009842 to
2c0694f
Compare
atscott
force-pushed
the
fix-redirect-after-commit
branch
from
October 1, 2026 19:55
2c0694f to
edd00af
Compare
…te commit When an error occurs after `BeforeActivateRoutes` has already committed `targetRouterState` and `withNavigationErrorHandler` returns a `RedirectCommand`, the transition emits a redirecting `NavigationCancel` instead of `NavigationError`. Previously, `StateManager` skipped resetting internal state on all redirecting cancellations because redirects from guards and resolvers happen prior to `BeforeActivateRoutes`. This left the uncommitted or half-activated `targetRouterState` (whose unactivated routes do not yet have `snapshot` assigned) as the current `routerState` for the subsequent redirect navigation. This change resets internal state if a redirecting cancellation occurs after `targetRouterState` was already committed. Fixes angular#71126
atscott
force-pushed
the
fix-redirect-after-commit
branch
from
October 1, 2026 20:12
edd00af to
654828d
Compare
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.
When an error occurs after
BeforeActivateRouteshas already committedtargetRouterStateandwithNavigationErrorHandlerreturns aRedirectCommand, the transition emits a redirectingNavigationCancelinstead ofNavigationError. Previously,StateManagerskipped resetting internal state on all redirecting cancellations because redirects from guards and resolvers happen prior toBeforeActivateRoutes. This left the half-activatedtargetRouterState(whose unactivated routes do not yet havesnapshotassigned) as the currentrouterStatefor the subsequent redirect navigation.This change resets internal state if a redirecting cancellation occurs after
targetRouterStatewas already committed.Fixes #71126