You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default retryConditionisNetworkOrIdempotentRequestError only retries for 429 rate limiting when the request type is one of IDEMPOTENT_HTTP_METHODS, but ideally 429 means that the request was rejected without starting the execution so it should be safe to retry.
Using code in this comment as a work-around for now.
The text was updated successfully, but these errors were encountered:
I completely understand your frustration—I'm also in a situation where I need to make batch requests with the POST method to external APIs, so thanks a lot for your workaround!
That said, I can also appreciate the intent of the library's authors here. The decision to restrict retries to idempotent methods is a reasonable safety measure, especially when dealing with potentially costly operations. Additionally, the fact that the retryCondition option allows for customization, and that isNetworkOrIdempotentRequestError is exposed, offers a manageable way to override the default behavior when needed. In that sense, the approach feels quite rational.
However, I agree with you that the limitation on retries to idempotent methods is under-documented. It’s buried within the retryCondition parameter’s description, which isn’t intuitive. I set up the library this morning, went through the README, and even dove into the source to adjust the retryDelay, but I hadn’t noticed this particular restriction until encountering it here. More explicit documentation in the README would go a long way in improving developer experience and clarifying behavior expectations upfront.
The default
retryCondition
isNetworkOrIdempotentRequestError only retries for 429 rate limiting when the request type is one ofIDEMPOTENT_HTTP_METHODS
, but ideally 429 means that the request was rejected without starting the execution so it should be safe to retry.Using code in this comment as a work-around for now.
The text was updated successfully, but these errors were encountered: