Skip to content

fix(router): avoid restarting fetcher revalidations#15129

Open
dogxii wants to merge 1 commit into
remix-run:mainfrom
dogxii:fix/fetcher-revalidation-navigation
Open

fix(router): avoid restarting fetcher revalidations#15129
dogxii wants to merge 1 commit into
remix-run:mainfrom
dogxii:fix/fetcher-revalidation-navigation

Conversation

@dogxii
Copy link
Copy Markdown
Contributor

@dogxii dogxii commented May 31, 2026

Summary:

Testing:

  • pnpm test packages/react-router/tests/router/fetchers-test.ts
  • pnpm test packages/react-router/tests/router
  • pnpm prettier --check packages/react-router/lib/router/router.ts packages/react-router/tests/router/fetchers-test.ts packages/react-router/.changes/patch.fetcher-revalidation-navigation.md
  • git diff --check
  • pnpm run typecheck
  • pnpm build

Copilot AI review requested due to automatic review settings May 31, 2026 05:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Prevents GET navigations from aborting/restarting fetcher revalidations that are already in-flight (typically triggered by action submissions), allowing the original revalidation to complete.

Changes:

  • Track in-flight fetcher revalidations via revalidatingFetchersInFlight and thread it through getMatchesToLoad
  • Skip restarting a fetcher load during navigation revalidation when the same fetcher is already revalidating in-flight (unless it was explicitly cancelled)
  • Update fetcher test expectations and add a patch changes entry

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/react-router/lib/router/router.ts Adds and uses an in-flight revalidation tracking set to avoid restarting fetcher revalidations during GET navigations
packages/react-router/tests/router/fetchers-test.ts Updates test to assert in-flight action revalidation fetchers are not aborted/restarted by navigation
packages/react-router/.changes/patch.fetcher-revalidation-navigation.md Documents the patch-level behavior change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revalidating fetchers incorrectly reloading on GET navigations

3 participants