-
Notifications
You must be signed in to change notification settings - Fork 169
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
retryCondition not called anymore on HTTP 401 starting from axios-retry v3.2.0 #240
Comments
I don't know in which commit the change was made, etc., but it seems to me that not retrying on 401 is the way the spec should be. Since 401 is an Unauthorized error, I don't think it should be retried, as it is certain to be an error no matter how many times it is retried. |
Not that I'm aware of, but as @yutak23 pointed out, this is the intended behaviour I don't remember which ones, but there are a couple of issues discussing about this and how to workaround |
Some actor may not follow the standards, I think letting the choice to the user is more suitable, as such we can still reproduce how the spec should be and have more flexibility at the same time. |
If the default spec is unchangeable, which I agree would be a major problem. I have a custom implementation as well. Specifically, the default is to retry 503, but that was problematic in my application, so I implemented not to retry 503. |
@bennycode : Have you found a solution for your case? |
@devfacet no, I haven't. The PR to upgrade axios-retry from 3.1.9 to 3.8.0 is failing because of the bug reported here. |
I recently tried to upgrade my axios-retry v3.1.9 but any newer version (starting from 3.2.0) has a behaviour change. In v3.1.9 (used together with axios v1.4.0) my
axiosRetry
gets called on a HTTP 401 error:I noticed when I upgrade to axios-retry v3.2.0 (or newer) my
axiosRetry
doesn't get called anymore on a HTTP 401 error. Instead the axios call fails and returns a generic'Request failed with status code 401'
error message.@mindhells was there any behaviour change in axios-retry that could cause this? Is this newly added shouldRetry function intercepting it?
Here is how my test is set up: https://github.com/bennycode/ig-trading-api/blob/v0.13.5/src/dealing/DealingAPI.test.ts#L474-L517
Best,
Benny
The text was updated successfully, but these errors were encountered: