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

axios-retry does single retry only when used with axios@1.1.3 #213

Closed
skorponek opened this issue Oct 19, 2022 · 2 comments
Closed

axios-retry does single retry only when used with axios@1.1.3 #213

skorponek opened this issue Oct 19, 2022 · 2 comments

Comments

@skorponek
Copy link

axios-retry is configured to do 2 retries:

... axiosRetry(this.httpClient, { retries: 2, retryCondition: isNetworkOrIdempotentRequestError, onRetry: this._onRetry } ...

onRetry logs warnings about retry attemps and jest + nock is used to test this with toHaveBeenCalledTimes, which fails unit test as there is just 1 retry counted, although 2 are expected.

  • OK: 2 warnings are logged correctly with axios 0.2.7 and axios-retry 3.3.1.
  • OK: 2 warnings are logged correctly with axios 1.0.0-alpha.1 and axios-retry 3.3.1.
  • PROBLEM: only 1 warning is logged wrongly with axios 1.1.1 and 1.1.3 when using axios-retry 3.3.1.

Issues seems to be that axios-retry no longer succeeds to do more than 1 retry even if there was more retries configured. axios-retry can be configured to 0 and there will be no retries, but having 2+ retries configured will always result to 1 retry only.

Do you guys know if this is error to be fixed with axios-retry, or if something has changed in regards of jest + nock recently?

@paulsouche
Copy link

Hello ! There is an opened PR on axios to fix that axios/axios#5090

@mindhells
Copy link
Member

I believe based on @paulsouche comment we can close this

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

3 participants