Repository navigation
Conversation
EpicHigh
force-pushed
the
fix/abandoned-fetcher-navigation-reloads
branch
from
November 6, 2026 15:03
75129ff to
12da380
Compare
EpicHigh
marked this pull request as ready for review
November 6, 2026 15:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fetcher action can start revalidating a pending navigation that is subsequently abandoned. When that reload finishes before the newer navigation, it currently commits results for the abandoned URL: current loader data disappears, errors can replace the current form, and redirects can cancel the newer navigation.
Reproduction in the first commit:
/currentremains visible./previousbefore the action resolves./previous./next, abandoning/previous./nextis still pending.The Framework Mode browser tests hold single-fetch responses to force this ordering and verify that an unsaved form stays mounted for data, error, and redirect responses. All three fail on base
db80dda076ec9cdcefff480079252fe0c977710e. Of 28 focused router cases, 24 fail on that base and four controls pass.Review found that POP and explicit revalidation can restart navigation with the same location key. Twelve added router cases fail on the previous PR head
12da380, and three added browser cases also fail there. The final focused file has 42 cases, including unmount cleanup controls, and the browser fixture has six cases covering preservation of the draft and legitimate errors/redirects from the latest request.The reload retains the controller of the navigation it is reloading. A reused location key therefore cannot make a superseded navigation look active. Results for an abandoned destination are discarded, while reloads of the displayed pathname/search remain allowed. The completed action result is preserved, and only secondary fetchers still owned by that reload are settled, including controller-free 404 results after HMR. This preserves the existing “commits both” behavior.
This affects the shared client router used by Data and Framework modes.
Related work:
Validation on
d2af1917a401b7c7af1e78d4ae44d1c991e4ecb6:pnpm test packages/react-router/ --runInBand: 125 suites, 2,967 tests and 824 snapshots pass; 15 existing skips.pnpm test:integration:run integration/fetcher-abandoned-navigation-test.ts --project chromium --workers 1 --retries 0 --reporter line: all six pass after the fix.pnpm build, package and integration typechecks, scoped ESLint and Prettier checks pass. ESLint reports only two warnings also present on unmodified upstream.The full integration suite and other browser engines were not run.
Upstream CI for this exact head is awaiting maintainer approval before it can run: Unit Test. The results above are local validation.