Skip to content

fix(history): replace the URL on an unmatched redirect - #115

Merged
vincentkoc merged 2 commits into
mainfrom
fix/unmatched-redirect-history
Nov 20, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/unmatched-redirect-history

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

When a loader redirects to an unmatched path, the router shows its not-found state while the browser address stays on the source route.

User Impact

The browser address shows the full redirect destination, including search and hash. Back returns to the location before the source route.

Why This Change Was Made

Apply the requested history write on both the matched and unmatched paths. Direct unmatched location handling retains its existing history mode.

Evidence

An isolated Chromium run exercised pushState, replaceState and Back. The base stayed on /source while the router reported /missing?from=source#detail. The fixed browser URL matched the router, and Back returned to /start. The regression checks both a declared destination and an unmatched one.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc marked this pull request as ready for review November 20, 2026 15:55
@vincentkoc
vincentkoc requested a review from a team as a code owner November 20, 2026 15:55
@vincentkoc
vincentkoc merged commit 4b5f54d into main Nov 20, 2026
10 checks passed
@vincentkoc
vincentkoc deleted the fix/unmatched-redirect-history branch November 20, 2026 15:59
vincentkoc added a commit that referenced this pull request Nov 20, 2026
…replay

* origin/main:
  fix(history): replace the URL on an unmatched redirect (#115)
  refactor(tests): consolidate pending invalidation scenarios (#118)
  fix(loading): accept redirect records without a route location as data (#116)
  fix(loading): ignore a component import from before stop (#113)

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant