Skip to content

fix: honor newer target during pending history transition - #689

Open
sean0407 wants to merge 1 commit into
solidjs:mainfrom
sean0407:codex/solid-router-687-back-forward-pending-20261020
Open

sean0407 wants to merge 1 commit into
solidjs:mainfrom
sean0407:codex/solid-router-687-back-forward-pending-20261020

Conversation

@sean0407

Copy link
Copy Markdown

Summary

When a route transition is pending:
  compare the next location with the pending target
  let a newer Back/Forward target replace that transition

The router compared history events with the last committed location. During a suspended Back transition, that made Forward to the committed location look like a no-op. Compare with the pending target when one exists, and add a regression test and patch changeset.

Evidence

  • Before: the Back-to-/slow then Forward-to-/fast regression failed. The history was at /fast, while the router committed /slow after the resource resolved.
  • After: the regression passes; the rendered location remains /fast.
  • pnpm test: 260 tests passed; test typecheck passed.
  • pnpm build: passed.
  • git diff --check: passed.
  • Patch policy accepted 3 text files / 70 changed lines; no binary files.

Merge Danger

Door: two-way

Blast Radius: localized

Fixes #687

@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a41ac0a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

Forward pressed while a Back navigation is still loading is dropped; the URL and the rendered route get out of sync

1 participant