-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(router): fix a problem with router not responding to back button #30160
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
Closed
+28
−0
Conversation
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
There was a problem with a combination of the `eager` URL update, browser `back` button, and hybrid applications. Details provided in internal ticket http://b/123667227. This fix handles the problem by setting `router.browserUrlTree` when all conditions have failed, meaning the browser doesn't do anything with the navigation other than update internal data structures. Without this change, the problem was an old value was stored in `router.broserUrlTree` causing some new navigations to be compared to an old value and breaking future navigations.
mhevery
approved these changes
Apr 26, 2019
@jasonaden Linter is failing, so I added "cleanup" to this. |
@jasonaden Still failing :-( |
6b2f28d
to
cc785f4
Compare
Thanks... passed now. |
kara
pushed a commit
that referenced
this pull request
May 6, 2019
…30160) There was a problem with a combination of the `eager` URL update, browser `back` button, and hybrid applications. Details provided in internal ticket http://b/123667227. This fix handles the problem by setting `router.browserUrlTree` when all conditions have failed, meaning the browser doesn't do anything with the navigation other than update internal data structures. Without this change, the problem was an old value was stored in `router.broserUrlTree` causing some new navigations to be compared to an old value and breaking future navigations. PR Close #30160
jasonaden
added a commit
to jasonaden/angular
that referenced
this pull request
May 8, 2019
… button (angular#30160)" This reverts commit 3327bd8.
alxhub
pushed a commit
that referenced
this pull request
May 8, 2019
alxhub
pushed a commit
that referenced
this pull request
May 8, 2019
jasonaden
added a commit
to jasonaden/angular
that referenced
this pull request
May 8, 2019
…se redirect is skipped In some cases where multiple navigations happen to the same URL, the router will not process a given URL. In those cases, we fall into logic that resets state for the next navigation. One piece of this resetting is to set the `browserUrlTree` to the most recent `urlAfterRedirects`i. However, there was bug in this logic because in some cases the `urlAfterRedirects` is a stale value. This happens any time a URL won't be processed, and the previous URL will also not be processed. This creates unpredictable behavior, not the least of which ends up being a broken `back` button. This PR kicks off new navigations with the current value the router assumes is in the browser. All the logic around how to handle future navigations is based on this value compared to the current transition, so it's important to kick off all new navigations with the current value so in the edge case described above we don't end up with an old value being set into `browserUrlTree`. Fixes angular#30340 Related to angular#30160
jasonaden
added a commit
to jasonaden/angular
that referenced
this pull request
May 8, 2019
…se redirect is skipped In some cases where multiple navigations happen to the same URL, the router will not process a given URL. In those cases, we fall into logic that resets state for the next navigation. One piece of this resetting is to set the `browserUrlTree` to the most recent `urlAfterRedirects`i. However, there was bug in this logic because in some cases the `urlAfterRedirects` is a stale value. This happens any time a URL won't be processed, and the previous URL will also not be processed. This creates unpredictable behavior, not the least of which ends up being a broken `back` button. This PR kicks off new navigations with the current value the router assumes is in the browser. All the logic around how to handle future navigations is based on this value compared to the current transition, so it's important to kick off all new navigations with the current value so in the edge case described above we don't end up with an old value being set into `browserUrlTree`. Fixes angular#30340 Related to angular#30160
jasonaden
added a commit
to jasonaden/angular
that referenced
this pull request
May 8, 2019
… to back button (angular#30160)" (angular#30320)" This reverts commit 8ced321.
alxhub
pushed a commit
that referenced
this pull request
May 15, 2019
…se redirect is skipped (#30344) In some cases where multiple navigations happen to the same URL, the router will not process a given URL. In those cases, we fall into logic that resets state for the next navigation. One piece of this resetting is to set the `browserUrlTree` to the most recent `urlAfterRedirects`i. However, there was bug in this logic because in some cases the `urlAfterRedirects` is a stale value. This happens any time a URL won't be processed, and the previous URL will also not be processed. This creates unpredictable behavior, not the least of which ends up being a broken `back` button. This PR kicks off new navigations with the current value the router assumes is in the browser. All the logic around how to handle future navigations is based on this value compared to the current transition, so it's important to kick off all new navigations with the current value so in the edge case described above we don't end up with an old value being set into `browserUrlTree`. Fixes #30340 Related to #30160 PR Close #30344
alxhub
pushed a commit
that referenced
this pull request
May 15, 2019
alxhub
pushed a commit
that referenced
this pull request
May 15, 2019
…se redirect is skipped (#30344) In some cases where multiple navigations happen to the same URL, the router will not process a given URL. In those cases, we fall into logic that resets state for the next navigation. One piece of this resetting is to set the `browserUrlTree` to the most recent `urlAfterRedirects`i. However, there was bug in this logic because in some cases the `urlAfterRedirects` is a stale value. This happens any time a URL won't be processed, and the previous URL will also not be processed. This creates unpredictable behavior, not the least of which ends up being a broken `back` button. This PR kicks off new navigations with the current value the router assumes is in the browser. All the logic around how to handle future navigations is based on this value compared to the current transition, so it's important to kick off all new navigations with the current value so in the edge case described above we don't end up with an old value being set into `browserUrlTree`. Fixes #30340 Related to #30160 PR Close #30344
alxhub
pushed a commit
that referenced
this pull request
May 15, 2019
BioPhoton
pushed a commit
to BioPhoton/angular
that referenced
this pull request
May 21, 2019
…ngular#30160) There was a problem with a combination of the `eager` URL update, browser `back` button, and hybrid applications. Details provided in internal ticket http://b/123667227. This fix handles the problem by setting `router.browserUrlTree` when all conditions have failed, meaning the browser doesn't do anything with the navigation other than update internal data structures. Without this change, the problem was an old value was stored in `router.broserUrlTree` causing some new navigations to be compared to an old value and breaking future navigations. PR Close angular#30160
BioPhoton
pushed a commit
to BioPhoton/angular
that referenced
this pull request
May 21, 2019
… button (angular#30160)" (angular#30320) This reverts commit 3327bd8. PR Close angular#30320
BioPhoton
pushed a commit
to BioPhoton/angular
that referenced
this pull request
May 21, 2019
…se redirect is skipped (angular#30344) In some cases where multiple navigations happen to the same URL, the router will not process a given URL. In those cases, we fall into logic that resets state for the next navigation. One piece of this resetting is to set the `browserUrlTree` to the most recent `urlAfterRedirects`i. However, there was bug in this logic because in some cases the `urlAfterRedirects` is a stale value. This happens any time a URL won't be processed, and the previous URL will also not be processed. This creates unpredictable behavior, not the least of which ends up being a broken `back` button. This PR kicks off new navigations with the current value the router assumes is in the browser. All the logic around how to handle future navigations is based on this value compared to the current transition, so it's important to kick off all new navigations with the current value so in the edge case described above we don't end up with an old value being set into `browserUrlTree`. Fixes angular#30340 Related to angular#30160 PR Close angular#30344
BioPhoton
pushed a commit
to BioPhoton/angular
that referenced
this pull request
May 21, 2019
… to back button (angular#30160)" (angular#30320)" (angular#30344) This reverts commit 8ced321. PR Close angular#30344
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
action: merge
The PR is ready for merge by the caretaker
area: router
cla: yes
target: patch
This PR is targeted for the next patch release
type: bug/fix
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.
There was a problem with a combination of the
eager
URL update, browserback
button, and hybrid applications. Details provided in internal ticket http://b/123667227.This fix handles the problem by setting
router.browserUrlTree
when all conditions have failed, meaning the browser doesn't do anything with the navigation other than update internal data structures. Without this change, the problem was an old value was stored inrouter.broserUrlTree
causing some new navigations to be compared to an old value and breaking future navigations.