Skip to content
Source
Sign inSign up
TanStack/query

fix(useQueries): check error boundary before retry to prevent infinite refetch #5271

Mergedbouncehead13(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/5271/headmerged by TkDodo View on GitHub

Fixes #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. The latest updates on your projects. Learn more about Vercel for Git ↗︎

      1 Ignored Deployment
      NameStatusPreviewCommentsUpdated (UTC)
      query⬜️ Ignored (Inspect)Apr 15, 2023 6:27pm
    2. 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:

      SandboxSource
      @tanstack/query-example-react-basic-typescriptConfiguration
      @tanstack/query-example-solid-basic-typescriptConfiguration
      @tanstack/query-example-svelte-basicConfiguration
      @tanstack/query-example-vue-basicConfiguration
      elated-sanne-xlcendIssue #4644
      upbeat-hertz-5o2iylIssue #4644
    3. ☁️ 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

    4. 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        6           
    Impacted FilesCoverage Δ
    packages/react-query/src/useQueries.ts94.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.