-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly handle fetcher redirects interrupted by normal navigations #10674
Conversation
🦋 Changeset detectedLatest commit: f25bc16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
revalidatingFetchers[redirect.idx - matchesToLoad.length].key; | ||
fetchRedirectIds.add(fetcherKey); | ||
} | ||
await startRedirectNavigation(state, redirect.result, { replace }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding to fetchRedirectIds
avoids redirect loops of revalidating fetchers
let doneFetcher = getDoneFetcher(undefined); | ||
state.fetchers.set(key, doneFetcher); | ||
updateState({ fetchers: new Map(state.fetchers) }); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flip submitting fetchers to done if they come back with a redirect after we've already started a separate navigation
let doneFetcher = getDoneFetcher(undefined); | ||
state.fetchers.set(key, doneFetcher); | ||
updateState({ fetchers: new Map(state.fetchers) }); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flip loading fetchers to done if they come back with a redirect after we've already started a separate navigation. Note that they'll be eligible for revalidation so they'll run again and if they redirect that time it will be processed
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
If a fetcher loader/action is in-flight, and a new navigation is started, and then the loader/action completes with a redirect, we should be ignoring the redirect since the navigation came after it.
Closes remix-run/remix#6695