Skip to content

[pull] main from remix-run:main - #326

Merged
pull[bot] merged 2 commits into
code:mainfrom
remix-run:main
Aug 3, 2026
Merged

[pull] main from remix-run:main#326
pull[bot] merged 2 commits into
code:mainfrom
remix-run:main

Conversation

@pull

@pull pull Bot commented Aug 3, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

dependabot Bot and others added 2 commits August 3, 2026 15:24
Signed-off-by: dependabot[bot] <support@github.com>
…revalidation (#15365)

* fix(router): drop the reload id when a fetcher action is aborted mid-revalidation

`handleFetcherAction` records a `fetchReloadIds` entry once the action
resolves and post-action revalidation begins, and deletes it when that
revalidation completes. The aborted bail-out sits one line above that
delete, so any abort landing in the window leaves the entry behind.

An aborted fetcher then goes idle and is pruned from `state.fetchers` by
`updateState`, which for a still-mounted fetcher uses a bare Map delete
that skips the auxiliary maps. The next `abortStaleFetchLoads` or
`markFetchersDone` caller iterates `fetchReloadIds`, finds the orphaned
key, and throws `Expected fetcher: <key>`. It surfaces as an unhandled
rejection, so no error boundary catches it and the in-flight navigation
dies.

Moving the delete above the bail-out covers every abort path at once.
`fetchControllers` needs no equivalent change: `abortFetcher` deletes
from it as part of aborting, so it is self-cleaning on this path, which
is why the original code could skip it on the early return.
`fetchReloadIds` has no such path — its only other deletion site is
`deleteFetcher`. That asymmetry is the bug.

The non-aborted path is unchanged: there is no `await` between the
line's old and new position, only the `if` test and a
`removeEventListener`, neither of which reads `fetchReloadIds`.

Adds two tests, both failing before this change:

- `submit()` then `load()` on the same key, with no `reset()` involved
- `reset()` during post-action revalidation

* Updates

* Fix fetcher error on navigation with aborted revalidation

Clarified the issue with `handleFetcherAction` and its handling of aborted fetchers, which led to unhandled rejections during navigation.

---------

Co-authored-by: Matt Brophy <matt@brophy.org>
@pull pull Bot locked and limited conversation to collaborators Aug 3, 2026
@pull pull Bot added the ⤵️ pull label Aug 3, 2026
@pull
pull Bot merged commit db19184 into code:main Aug 3, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant