Skip to content

feat(KNO-16047): add maxRetries option to ApiRequestConfig - #1087

Open
mattmikolay wants to merge 3 commits into
mainfrom
mattmik-kno-16047-sdks-add-maxretries-option-to-apirequestconfig
Open

mattmikolay wants to merge 3 commits into
mainfrom
mattmik-kno-16047-sdks-add-maxretries-option-to-apirequestconfig

Conversation

@mattmikolay

Copy link
Copy Markdown
Contributor

Description

This PR adds a maxRetries option to ApiRequestConfig, allowing API requests made using the ApiClient's makeRequest function to specify the maximum number of times they should be retried when a retryable error occurs. When maxRetries is set to 0, retries will be disabled.

This PR is a prerequisite to #1085.

Checklist

  • Tests have been added for new features or major refactors to existing features.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
javascript-ms-teams-connect-example Ready Ready Preview Oct 20, 2026 3:09pm UTC
javascript-nextjs-example Ready Ready Preview Oct 20, 2026 3:09pm UTC
javascript-slack-connect-example Ready Ready Preview Oct 20, 2026 3:09pm UTC
javascript-slack-kit-example Ready Ready Preview Oct 20, 2026 3:09pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee69dec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@knocklabs/client Minor
client-example Patch
guide-example Patch
@knocklabs/expo Patch
@knocklabs/react-core Patch
@knocklabs/react-native Patch
@knocklabs/react Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
slack-connect-example Patch
slack-kit-example Patch

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

@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

KNO-16047

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 57 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@knocklabs/client-client-esm 70.18kB 34 bytes (0.05%) ⬆️
@knocklabs/client-client-cjs 58.77kB 23 bytes (0.04%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @knocklabs/client-client-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
api.mjs 34 bytes 6.03kB 0.57%

Files in api.mjs:

  • ./src/api.ts → Total Size: 7.69kB
view changes for bundle: @knocklabs/client-client-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
api.js 23 bytes 4.88kB 0.47%

Files in api.js:

  • ./src/api.ts → Total Size: 7.75kB

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.42%. Comparing base (b429cf0) to head (ee69dec).
✅ All tests successful. No failed tests found.

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              
Files with missing lines Coverage Δ
packages/client/src/api.ts 91.30% <100.00%> (+0.09%) ⬆️

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved: this is a feature change, not a dependency update, so it is outside the auto-approval policy. Human review is needed; no reviewers were assigned in this run. CI is currently green.

Open in Web View Automation 

Sent by Cursor Approval Agent: Depdency updates (control, CLI, javascript, telegraph)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved. This is a client SDK feature change (ApiRequestConfig maxRetries), not an auto-release, dependency update, or documentation-only PR, so it needs product-team review. Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK approver

@kylemcd kylemcd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment nothing blocking

headers?: HeadersInit;
signal?: AbortSignal;
/** Max number of retries for retryable failures. Set this to 0 to disable retries. */
maxRetries?: number;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be named maxRequestRetries to be consistent? also opens up for any other retries that may exist in the future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
});

This branch was successfully deployed

4 active deployments
Preview – javascript-ms-teams-connect-example — ee69dec0 Deployed Oct 20, 2026 by vercel[bot]
Preview – javascript-slack-kit-example — ee69dec0 Deployed Oct 20, 2026 by vercel[bot]
Preview – javascript-slack-connect-example — ee69dec0 Deployed Oct 20, 2026 by vercel[bot]
Preview – javascript-nextjs-example — ee69dec0 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants