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

[RTK-Query]: useQuery hook does not refetch after resetApiState (2) #3778

Open
manceauJb opened this issue Oct 5, 2023 · 3 comments · May be fixed by #4758
Open

[RTK-Query]: useQuery hook does not refetch after resetApiState (2) #3778

manceauJb opened this issue Oct 5, 2023 · 3 comments · May be fixed by #4758
Labels
bug Something isn't working rtk-query
Milestone

Comments

@manceauJb
Copy link
Contributor

Description:

This issue appears to be a bug in RTK-Query, which should have been resolved by #1735 and #3333. However, it appears that the problem persists.

Reproduction Steps:

  1. Access the following example showcasing the issue: CodeSandbox
  2. Click on the "Rerender Component" button.
  3. Click on the "Reset Api State" button.

Expected Behavior:

After clicking "Reset API State," the request should not remain stuck in a pending status. Instead, it should automatically re-fetch the query. Currently, the request remains pending until the component is re-rendered. Even if we attempt to manually refetch, the query is executed, but the result remains pending.

@phryneas
Copy link
Member

phryneas commented Oct 7, 2023

Yup, I can see that. Weird that it only happens after a rerender 🤔

@phryneas phryneas added the bug Something isn't working label Oct 7, 2023
@markerikson markerikson added this to the 1.9.x milestone Oct 7, 2023
@etozhealkhipce
Copy link

@phryneas

Is there any fixes for this?
I have same issue on my project

@bennyszantar
Copy link

Same thing in my project.

@markerikson markerikson modified the milestones: 1.9.x, 2.x bugfixes Dec 6, 2023
@markerikson markerikson added the rtk-query label Feb 5, 2024 — with Volta.net
@reduxjs reduxjs deleted a comment from zigcccc Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rtk-query
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants