-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Using "Retry-After" with error code 425 is impossible #473
Comments
Allowing to override Current implementation doesn't allow to override it: Lines 39 to 43 in 53ce279
Removing line 42 will fix the issue. |
Curious what the use-case here was. 425 status codes are really a part of the initial handshake process and should be handled by either the browser/Node themselves through an immediate connection reset as specified in 8470 section 4 and demonstrated in the Firefox implementation. A 425 falling down into the JS seems like it would indicate a configuration issue or bug in the server/environment. Of course, allowing users to set |
@sindresorhus ping |
@mahnunchik The maintainer responds more to PRs than to issues (they have... uh... a few repositories). In the next month or so I can probably get to this; unless you beat me to it, of course. 😄 |
Is it possible for If so, you should be able to implement this already with a We |
Ah, tracing back the origin of that offending line, it seems there was actually a discussion about this very thing back in 2019:
But we did end up accidentally exposing it, and seems like the article OP linked has at least a couple of users thinking it's a part of the intended public interface. This also means IDE autocomplete for TS has been broadcasting this "customizable" property for the whole time. In light of that, I still think it's best to just let users overwrite the property instead, rather than going through the trouble to artificially impose an |
Hi there,
I would like to change the way the retries are made. For example: wait 1s before each retry.
One option is to add a
retry.backoffLimit
optionAnother (by the time the PR is merged) would be to use the
Retry-After
header from the server.But unfortunately I can make it work with the
425
error code given by the server.It looks like the
afterStatusCodes
option, set by default to[413, 429, 503]
cannot be changed.I've tried these retry options :
The code I'm looking at is here: (Ky.ts) _calculateRetryDelay l.217
afterStatusCodes
is not in the docs… but I found it reading the code and in that articleAny help is welcome
The text was updated successfully, but these errors were encountered: