softonic / axios-retry

Axios plugin that intercepts failed requests and retries them whenever possible
Other
1.9k stars 167 forks source link

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

Closed skorponek closed 2 years ago

skorponek commented 2 years ago

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.

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 commented 2 years ago

Hello ! There is an opened PR on axios to fix that https://github.com/axios/axios/pull/5090

mindhells commented 2 years ago

I believe based on @paulsouche comment we can close this