-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix(vue-router): clear navigation info when a guard aborts navigation #31364
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
Open
thetaPC
wants to merge
24
commits into
main
Choose a base branch
from
FW-6706
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,134
−30
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e023609
fix(vue-router): clear navigation info when a guard aborts navigation
thetaPC 6d5c199
fix(vue-router): clear staged route params when a guard aborts naviga…
thetaPC 7ae3b16
docs(vue-router): clarify which navigation failures clear staged state
thetaPC b6c6e73
fix(vue-router): clear staged state when a navigation is cancelled
thetaPC d4b89b7
test(vue-router): use data-pageid in routing specs
thetaPC 4bbcc7a
test(vue-router): align routing spec setup with the rest of the file
thetaPC 2dc6efd
test(vue-router): tidy the navigation guard specs
thetaPC 7ff2c5e
fix(vue-router): only clear staged state from the failed navigation
thetaPC b1b2aca
Merge branch 'main' of github.com:ionic-team/ionic-framework into FW-…
thetaPC 1b50d95
docs(vue-router): correct what stages route params and when entries r…
thetaPC 101143e
test(vue-router): cover the back button path and fix a misleading spe…
thetaPC 64a77a6
test(vue-router): read the router through inject instead of the Vue i…
thetaPC 398cb36
test(vue-router): add exclamation
thetaPC 06e0174
test(vue-router): hoist the shared page factory to module scope
thetaPC 67125fe
fix(vue-router): record the target of staged route params
thetaPC 6856c6f
test(vue-router): add definite assignment assertions to the racing specs
thetaPC 6a6032f
docs(vue-router): use a doc block for the staged state comment
thetaPC f40d2d1
test(vue-router): link only the specs that reproduce the issue
thetaPC f469679
test(vue-router): assert the view stack and share the spec helpers
thetaPC 150ecb2
fix(vue-router): stage route params through a single writer
thetaPC f1f6a33
fix(vue-router): discard staged state when a guard rejects
thetaPC ec47c2f
test(vue-router): cover a blocked replace leaking its params
thetaPC 1b77808
fix(vue-router): reconcile staged params with redirects and query enc…
thetaPC c85f647
refactor(vue-router): clear the staged params through a single helper
thetaPC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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 hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An async guard that throws instead of returning
falsenever gets here at all, so the original bug still reproduces. InternallytriggerErrorhands back a rejected promise, so the.thenthat would calltriggerAfterEachnever runs and the.catch(noop)on the end eats it. No failure object, noafterEach.You don't need a deliberate
throweither, anawaiton a session check that rejects does it. On/profile, tap back, guard throws, then tap a link to/settings: the URL says/settingsbut Ionic reports/homewith apop, and the stack collapses down to just Home, so Settings never mounts and Profile gets destroyed. Same on main so nothing regressed, it's just not covered.Different thing from FW-7699, that one's the guard-returning-a-location case. I think a
router.onErrordoing the same two gated clears would close it, andonErrordoesn't swallow the error so it wouldn't change any navigation outcomes. Feels cheap enough to do here, but I'm fine with a card if you'd rather keep this PR tight.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.
f1f6a33