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

Cannot abort delayed retries #372

Open
veloware opened this issue Jun 20, 2022 · 0 comments
Open

Cannot abort delayed retries #372

veloware opened this issue Jun 20, 2022 · 0 comments

Comments

@veloware
Copy link

Describe the bug
When using retries, when the fetch is in the delay stage, i.e. delayed between retries, calling the abort function from the useFetch() hook has no effect.

⚠️ Make a Codesandbox ⚠️
Please do this to easily reproduce the bug.

To Reproduce
Steps to reproduce the behavior:

  • attach the abort() function to a button
  • make a fetch call that will cause a retry, with a reasonable delay for testing, say 5 secs.
  • after the first request has fullfilled and the fetch hook will delay for 5 secs before making the next request
  • during the delay, before the next request happens, click the button to call abort()
  • nothing happens, and the next request will eventually happen after the defined 5 secs.
  • click the button whilst the request is still in flight
  • it is finally aborted

Expected behavior
If delays are possible, it shouldn't matter when the abort is clicked, the subsequent requests should be aborted, not just an in flight request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant