Skip to content

fix double call of beforeOpen while Link navigated#59

Draft
sergeysova wants to merge 2 commits into
mainfrom
sova/happy-feistel-dca11d
Draft

fix double call of beforeOpen while Link navigated#59
sergeysova wants to merge 2 commits into
mainfrom
sova/happy-feistel-dca11d

Conversation

@sergeysova

@sergeysova sergeysova commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

Closes #53

Type of change

  • 🐛 Bug fix

Checklist

  • I linked a related issue (or explained why there isn't one)
  • pnpm build passes
  • pnpm typecheck passes
  • pnpm test passes and I added/updated tests for my change
  • pnpm lint passes
  • I added a changeset (pnpm changeset), or an empty one for no-release changes (pnpm changeset --empty)

Opening a route with a beforeOpen handler via route.open() (what <Link>
does) runs openFx once, then navigate -> locationUpdated -> navigated ->
navigatedFx re-runs openFx, executing beforeOpen a second time and
briefly leaving the route unopened (the reported 404 flash).

Refs: #53
Track the key of an in-flight imperative open() so its navigation
echo settles the route without re-running beforeOpen and parent
guards; external navigation (history.push) still runs them once.
@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e883e7c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sergeysova sergeysova changed the title Sova/happy feistel dca11d fix double call of beforeOpen while Link navigated Jul 12, 2026
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.

[Bug]: beforeOpen is called twice during link navigation

1 participant