Skip to content

fix(vue-router): render the redirect target when a guard redirects - #31510

Merged
ShaneK merged 1 commit into
mainfrom
FW-7699
Oct 1, 2026
Merged

ShaneK merged 1 commit into
mainfrom
FW-7699

Conversation

@ShaneK

@ShaneK ShaneK commented Sep 30, 2026

Copy link
Copy Markdown
Member

Issue number: internal


What is the current behavior?

Currently, when a guard returns a location instead of false during a back navigation, the URL updates to the redirect target but Ionic renders a different page. A redirect doesn't fail, so the original navigation never reaches afterEach or onError. Its staged delta and params are never cleared and get applied to the redirect target instead.

What is the new behavior?

The ownership beforeEach now discards the state a navigation claimed when a guard redirects it. We match it through redirectedFrom, which vue-router points at the first location in the redirect chain. That covers leave guards, which run before our hook, and a guard redirect to the current page, which fails as a duplicate before reaching beforeEach.

Does this introduce a breaking change?

  • Yes
  • No

Other information

This was raised while reviewing #31364 and left out of scope there.

@ShaneK
ShaneK requested a review from a team as a code owner September 30, 2026 20:02
@ShaneK
ShaneK requested a review from thetaPC September 30, 2026 20:02
@vercel

vercel Bot commented Sep 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Sep 30, 2026 8:02pm UTC

Request Review

@github-actions github-actions Bot added the package: vue @ionic/vue package label Sep 30, 2026

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneK
ShaneK added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 643584b Oct 1, 2026
69 checks passed
@ShaneK
ShaneK deleted the FW-7699 branch October 1, 2026 13:50

This branch was successfully deployed

1 active deployment
Preview — 0a460f25 Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants