-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix(router): eagerly update internal state on browser-triggered navigations #43102
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
Conversation
…ations The management of `browserUrlTree` currently has several problems with correctly tracking the actual state of the browser. This change makes the Router eagerly update the `browserUrlTree` when handling navigations triggered by browser events (i.e., not 'imperative'). This is because with those types of navigations, the browser URL bar is _already_ updated. If we do not update the internal tracking of the `browserUrlTree`, we will be out of sync with the real URL if the navigation is rejected. It would be best if we could remove `browserUrlTree` completely, but doing that would require a lot more investigation and is blocked by angular#27059 because the SpyLocation used in tests does not emulate real browser behavior. fixes angular#43101
35d219e
to
ff32c85
Compare
global presubmit with reruns shows no failures due to this change. |
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.
👍
merge assistance: while global presubmit ran and was green, this CL should still be merged and synced on its own to be safe. |
@atscott FYI there are some CI failures which look legit, could you please have a look? (adding the "cleanup" label for now) |
2356261
to
0aa0e9a
Compare
If this must go in on its own, I will wait until tomorrow and do a second merge and sync. |
…ations (#43102) The management of `browserUrlTree` currently has several problems with correctly tracking the actual state of the browser. This change makes the Router eagerly update the `browserUrlTree` when handling navigations triggered by browser events (i.e., not 'imperative'). This is because with those types of navigations, the browser URL bar is _already_ updated. If we do not update the internal tracking of the `browserUrlTree`, we will be out of sync with the real URL if the navigation is rejected. It would be best if we could remove `browserUrlTree` completely, but doing that would require a lot more investigation and is blocked by #27059 because the SpyLocation used in tests does not emulate real browser behavior. fixes #43101 PR Close #43102
PR angular#43102 broke some use-cases. These tests document expected behavior and would have prevented angular#43446 and angular#43447. Recent changes have already addressed these issues, but it would still be a good idea to cover these use-cases in tests as well.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The management of
browserUrlTree
currently has several problems withcorrectly tracking the actual state of the browser.
This change makes the Router eagerly update the
browserUrlTree
whenhandling navigations triggered by browser events (i.e., not 'imperative'). This
is because with those types of navigations, the browser URL bar is
already updated. If we do not update the internal tracking of the
browserUrlTree
, we will be out of sync with the real URL if thenavigation is rejected.
It would be best if we could remove
browserUrlTree
completely, but doing thatwould require a lot more investigation and is blocked by #27059 because
the SpyLocation used in tests does not emulate real browser behavior.
fixes #43101