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

fix: retry delay not persisting between calls #3478

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

DoisKoh
Copy link
Contributor

@DoisKoh DoisKoh commented Jan 17, 2024

Summary

Retry delays are not actually working as specified in the docs. Currently, retry delays are not persisted between retries, resulting in exponential backoff not actually increasing the delay amount as time goes on. The linear backoff also does not currently work.

I've added a unit test for this, as well as the change for the behavior to comply with what's actually stated in the docs.

Set of changes

  • Made retry delays persist in the context, allowing backoffs to work
  • Added unit test for retry delay
  • Modified an existing unit test that was failing (I believe it might have been incorrect, but I'm not entirely sure, please verify! It seems like the retry value is meant to reset after a retry that was successful [so, a successful operation], but the unit test was checking the retry values after a failed/errored operation instead. However, the test was passing because the retry delays were never being carried across operations anyway.)

Copy link

changeset-bot bot commented Jan 17, 2024

🦋 Changeset detected

Latest commit: 0d73b93

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@urql/exchange-retry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JoviDeCroock JoviDeCroock merged commit 1fabe35 into urql-graphql:main Jan 17, 2024
7 checks passed
@github-actions github-actions bot mentioned this pull request Jan 17, 2024
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

Successfully merging this pull request may close these issues.

2 participants