Replace @knocklabs/client axios transport with fetch#1010
Conversation
Co-authored-by: Chris Bell <chris@cjbell.co>
🦋 Changeset detectedLatest commit: ed8b4dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f88dfad. Configure here.
| // Retry Network Errors. | ||
| if (axiosRetry.isNetworkError(error)) { | ||
| private canRetryRequest(error: unknown) { | ||
| if (error instanceof TypeError) { |
There was a problem hiding this comment.
TypeError retry too broad
Medium Severity
canRetryRequest treats every TypeError as retriable, but requestWithRetries wraps buildUrl, buildRequestInit, and fetch in the same try/catch. Invalid URLs, bad params, or non-JSON-serializable data throw TypeError before any network I/O and still get up to three extra attempts with backoff.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f88dfad. Configure here.
Co-authored-by: Chris Bell <chris@cjbell.co>
Co-authored-by: Chris Bell <chris@cjbell.co>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1010 +/- ##
==========================================
+ Coverage 63.55% 63.95% +0.40%
==========================================
Files 208 208
Lines 9924 10082 +158
Branches 1280 1338 +58
==========================================
+ Hits 6307 6448 +141
- Misses 3592 3609 +17
Partials 25 25
|


Description
Replace the internal
@knocklabs/clientHTTP transport from axios/axios-retry to nativefetchwhile preserving the existingmakeRequest({ method, url, params, data })call shape. This also removes the axios dependencies from the client package and adds a patch changeset.Follow-up review hardening adds a guarded fetch resolver with an actionable no-fetch error, explicit fetch network error classification, and regression coverage for abort/no-fetch/retry-exhaustion edge cases.
Todos
Checklist
Screenshots or videos
Not relevant for this non-UI SDK transport change.
Validation
yarn test packages/client/test/api.test.ts— 28 passedyarn test packages/client/test— 19 files / 549 tests passedyarn workspace @knocklabs/client type:check— passedyarn workspace @knocklabs/client lint— passedyarn workspace @knocklabs/client build— passedLinear Issue: KNO-12329