softonic/axios-retry

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

skorponek opened this issue · 2 comments

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?

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

I believe based on @paulsouche comment we can close this