prefetchItxQuery: no errored residue after a failed first fetch#1469
Merged
Conversation
Bugbot on #1457: a swallowed prefetch failure left an errored, data-less cache entry on the shared key, so the consuming component flashed its error state on mount before retryOnMount recovered. The catch now removes the entry when it is errored AND empty — the component mounts pending and fetches fresh. An entry that already has data is kept: stale data plus a background error beats no data. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Follow-up to #1457, addressing bugbot's "failed prefetch poisons query cache" finding: a swallowed prefetch failure left an errored, data-less entry on the shared query key, so the consuming component (streams tree, breadcrumb navigators) flashed its error state on mount before
retryOnMountrefetched. The catch now removes the entry when it is errored and empty — components mount pending and fetch fresh. Entries that already hold data are kept (stale data + background error beats no data), covered by a new revalidation test.🤖 Generated with Claude Code
Note
Low Risk
Narrow loader/cache hygiene change with matching unit tests; no auth or API surface changes.
Overview
Fixes a prefetch cache poisoning issue: when
prefetchItxQueryswallowed a failure on a first fetch, React Query still left an errored, data-less entry on the shared key, so streams tree / breadcrumb UI briefly showed error on mount beforeretryOnMountrefetched.After the catch, the loader now
removeQuerieswhen state iserroranddatais undefined, so consumers mount pending and fetch fresh. Stale entries with existing data are untouched when revalidation fails—stale data is preferred over wiping the cache.Tests now assert no cache residue on failed prefetch and add coverage for failed revalidation with seeded data.
Reviewed by Cursor Bugbot for commit 3219b15. Bugbot is set up for automated code reviews on this repo. Configure here.
Environment Config Lease
No active environment config lease.
OS
Status: released
Commit:
3219b15Preview: https://os.iterate-preview-4.com
Summary: Preview app released.
Workflow run
Updated: 2026-06-10T18:09:44.936Z