| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Ports TanStack#9338 to preact-query: ensurePreventErrorBoundaryRetry now receives the cached query and evaluates a function-form throwOnError against the actual error before setting retryOnMount = false, instead of treating any function as truthy. Includes the regression tests from TanStack#9338, two of which fail on current main. Fixes TanStack#11165 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 Walkthrough
WalkthroughPreact Query now evaluates functional throwOnError values against the cached query error before disabling retryOnMount. Query retrieval is reused across error-boundary and prefetch handling. Tests cover false, true, and error-specific predicates. ChangesPreact retry-on-mount error handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant useBaseQuery
participant QueryCache
participant ensurePreventErrorBoundaryRetry
participant shouldThrowError
useBaseQuery->>QueryCache: Retrieve cached query by queryHash
useBaseQuery->>ensurePreventErrorBoundaryRetry: Pass options, reset boundary, and query
ensurePreventErrorBoundaryRetry->>shouldThrowError: Evaluate throwOnError with query.error and query
shouldThrowError-->>ensurePreventErrorBoundaryRetry: Return resolved boolean
ensurePreventErrorBoundaryRetry->>useBaseQuery: Apply retryOnMount prevention when resolved value is true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@packages/preact-query/src/errorBoundaryUtils.ts`: - Around line 30-33: The throwOnError logic should evaluate the predicate for every query in an error state, including failures with falsy values such as 0, empty string, or null. Replace the query.state.error truthiness guard with the query’s established error-status check, preserving direct option handling for non-error states, and add coverage for a falsy rejected value.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9e770acb-1a84-48ad-bfad-7ea1ea56d651
📥 CommitsReviewing files that changed from the base of the PR and between 46d7f02 and 8948869.
📒 Files selected for processing (5)
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
🎯 Changes
Fixes #11165.
Ports #9338 to preact-query. react-query's ensurePreventErrorBoundaryRetry evaluates a function-form throwOnError against the query's actual error before disabling retryOnMount; preact-query's copy still treats any function as truthy, so throwOnError: () => false (or a predicate returning false for the current error) wrongly prevents an errored query from refetching on remount.
✅ Checklist
🚀 Release Impact
🤖 Generated with Claude Code
Summary by CodeRabbit