Replies: 1 comment
-
https://github.com/near/near-api-js/blob/master/packages/providers/src/fetch_json.ts#L8 current code |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Currently, the retry logic in the NEAR JS SDK's retryConfig() only retries on status codes [500, 503, 408] and certain fetch-related errors. However, in many real-world scenarios, especially when interacting with rate-limited endpoints, the 429 Too Many Requests error is common and should also trigger a retry.
Suggested Solutions:
Add 429 to the default retry status codes list.
This change would benefit many users out-of-the-box without requiring customization.
OR make the retry logic extensible by allowing a custom retry condition function to be passed as an argument.
Example Improvement (if extensibility is preferred):
Why This Matters:
Rate-limiting (429) is increasingly common.
Many developers need to handle this gracefully with retries.
Including 429 or making the logic customizable would prevent unnecessary request failures and improve resiliency.
Impact:
This is a backward-compatible enhancement. Existing behavior remains unchanged unless explicitly extended by the user.
Beta Was this translation helpful? Give feedback.
All reactions