Skip to content
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

Error temporarily persist for useQuery for different variable set #8497

Closed
dannycochran opened this issue Jul 14, 2021 · 2 comments
Closed
Assignees

Comments

@dannycochran
Copy link
Contributor

dannycochran commented Jul 14, 2021

Intended outcome:

  1. If I call useQuery from componentA with a distinct variable set, and that query has an error, I expect to have an error returned back int the query result.

  2. If I then change that variable set for the same query within componentA, the error should not continue to be returned, even temporarily.

Actual outcome:

The error from an older variable set is temporarily present until the fetch is complete, and then it is gone.

How to reproduce the issue:

  1. clone this repository (https://github.com/dannycochran/usequery) and checkout to the errors branch.
  2. npm run start
  3. Navigate to localhost:3000/124891248912491
  4. Notice that you will see an error from "useQuery", this is expected.
  5. Click the button to return home where there is no movie query parameter.
  6. Click the button to navigate to valid movie.
  7. Note a flicker where the error message will temporarily render, and note in the console that the error is still present from the "useQuery" return value.
  8. The error then disappears once the fetch is complete. However, since the variable set is distinct at this point, the "useQuery" state should be empty and there should be no cached value for this query yet.

it's possible this is related to #4644 which was never resolved.

Versions
System:
OS: macOS 11.4
Binaries:
Node: 12.18.4 - /usr/local/bin/node
Yarn: 1.22.4 - ~/npm-global/bin/yarn
npm: 6.14.6 - /usr/local/bin/npm
Browsers:
Chrome: 91.0.4472.114
Safari: 14.1.1
npmPackages:
@apollo/client: ^3.3.20 => 3.3.20
apollo-server-express: ^2.19.0 => 2.19.0
npmGlobalPackages:
apollo: 2.27.0

@benjamn benjamn added this to the MM-2021-07 milestone Jul 14, 2021
@hwillson hwillson removed this from the MM-2021-07 milestone Jul 29, 2021
@hwillson hwillson added 2021-08 and removed 2021-07 labels Aug 3, 2021
@brainkim brainkim mentioned this issue Aug 13, 2021
14 tasks
@brainkim brainkim assigned benjamn and brainkim and unassigned brainkim and benjamn Aug 13, 2021
brainkim added a commit that referenced this issue Aug 18, 2021
brainkim added a commit that referenced this issue Aug 18, 2021
@brainkim brainkim assigned benjamn and unassigned brainkim Aug 18, 2021
@brainkim
Copy link
Contributor

Fixed by something in 3.4.8.

@benjamn
Copy link
Member

benjamn commented Aug 18, 2021

We also have a regression test for this coming in 73569ef, part of @brainkim's big refactoring PR #8596.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants