fix(useQueries): check error boundary before retry to prevent infinite refetch #5271
main fromrefs/pull/5271/head·merged by TkDodo View on GitHubFixes #4644
Changes useQuery correctly handles checks on error boundary before retry. This work will change useQueries to match behavior.
Main problem I saw was the order of operations between the two. Moved the error boundary checks before the observer is instantiated.
Note: Unit tests were pulled from the existing PR #4882 to verify the change is working. Also tested this change in my own app.
- 1
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 4e60b8f5e3fedbba8fadc5eb9584f407b1264e9f:
Sandbox Source @tanstack/query-example-react-basic-typescript Configuration @tanstack/query-example-solid-basic-typescript Configuration @tanstack/query-example-svelte-basic Configuration @tanstack/query-example-vue-basic Configuration elated-sanne-xlcend Issue #4644 upbeat-hertz-5o2iyl Issue #4644 ☁️ Nx Cloud Report#
CI is running/has finished running commands for commit 4e60b8f5e3fedbba8fadc5eb9584f407b1264e9f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this branch
✅ Successfully ran 4 targets
nx run-many --target=test:build --projects=rootnx affected --target=test:lib --parallel=5 --base=a65e7f19dfadc52901e223f67112870effb53550nx affected --target=test:types --parallel=5 --base=a65e7f19dfadc52901e223f67112870effb53550nx affected --target=test:eslint --parallel=5 --base=a65e7f19dfadc52901e223f67112870effb53550
Sent with 💌 from NxCloud.
TkDodo approved these changes
please check the formatting - prettier needs to run on your changed files please
Codecov Report#
Patch coverage:
100.00% and no project coverage change.Comparison is base (
e66a285) 92.20% compared to head (4e60b8f) 92.20%.:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@ Coverage Diff @@ ## main #5271 +/- ## ======================================= Coverage 92.20% 92.20% ======================================= Files 39 39 Lines 1257 1257 Branches 355 355 ======================================= Hits 1159 1159 Misses 92 92 Partials 6 6Impacted Files Coverage Δ packages/react-query/src/useQueries.ts 94.73% <100.00%> (ø)Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report in Codecov by Sentry. :loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@TkDodo formatting all good now
TkDodo merged this98be9ec
TkDodo closed this
nice work, thank you ❤️
Sign in to join this conversation.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment