Skip to content

failed queries won't continue retries when unmounting and remounting while waiting for the retry #3031

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

Closed
TkDodo opened this issue Nov 27, 2021 · 1 comment · Fixed by #3032
Labels
bug Something isn't working released

Comments

@TkDodo
Copy link
Collaborator

TkDodo commented Nov 27, 2021

Describe the bug

Encountered while seeing strict effects being enabled, which might mount and unmount multiple times. The situation is:

  • component mounts, we fetch
  • fetch errors, we wait for retry (set retryDelay to a high time)
  • now, component unmounts and remounts
  • this "cancels" the retry, but the component stays in fetching state

--> once the retrier continues, it sees that the retry has been cancelled and just returns the error, but in fact, it should continue to retry because a new observer has mounted.

Potential solution is to expose a continueRetry method, which will undo the cancelRetry (its just a flag that is set to true) so that the retrier can continue. We can invoke this when we try to fetch but are already in fetching state and thus just return the current promise.

@TkDodo TkDodo added the bug Something isn't working label Nov 27, 2021
@tannerlinsley
Copy link
Collaborator

🎉 This issue has been resolved in version 3.33.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants