Repository navigation
feat(KNO-16047): add maxRetries option to ApiRequestConfig - #1087
mattmikolay wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: ee69dec The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bundle ReportChanges will increase total bundle size by 57 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @knocklabs/client-client-esmAssets Changed:
Files in
view changes for bundle: @knocklabs/client-client-cjsAssets Changed:
Files in
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1087 +/- ##
==========================================
+ Coverage 75.41% 75.42% +0.01%
==========================================
Files 139 139
Lines 4377 4379 +2
Branches 1287 1288 +1
==========================================
+ Hits 3301 3303 +2
Misses 976 976
Partials 100 100
|
| headers?: HeadersInit; | ||
| signal?: AbortSignal; | ||
| /** Max number of retries for retryable failures. Set this to 0 to disable retries. */ | ||
| maxRetries?: number; |
There was a problem hiding this comment.
should this be named maxRequestRetries to be consistent? also opens up for any other retries that may exist in the future?
There was a problem hiding this comment.
Is that a bit redundant, though? This type will only be used with the API client’s makeRequest method:
knock.client().makeRequest({
method: "GET",
url: "/v1/users",
// Redundant? Since we’re already using makeRequest here.
maxRequestRetries: 0,
});

Description
This PR adds a
maxRetriesoption toApiRequestConfig, allowing API requests made using theApiClient'smakeRequestfunction to specify the maximum number of times they should be retried when a retryable error occurs. WhenmaxRetriesis set to 0, retries will be disabled.This PR is a prerequisite to #1085.
Checklist
Stack created with GitHub Stacks CLI • Give Feedback 💬