Skip to content

fix(api-client): fix retry failing and add a timeout of 30s#305

Merged
gregberge merged 4 commits into
mainfrom
improve-api-client
May 20, 2026
Merged

fix(api-client): fix retry failing and add a timeout of 30s#305
gregberge merged 4 commits into
mainfrom
improve-api-client

Conversation

@gregberge
Copy link
Copy Markdown
Member

No description provided.

@gregberge gregberge requested review from a team, Copilot and jsfez and removed request for a team May 20, 2026 14:28
@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

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

Project Deployment Actions Updated (UTC)
argos-js-sdk-reference Ready Ready Preview, Comment May 20, 2026 2:57pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the API client’s custom fetch implementation to make retries reliable (by recreating requests and replaying the body) and introduces a default 30s request timeout, backed by new Vitest unit tests.

Changes:

  • Extract retry/timeout logic into a new apiFetch helper and wire it into createClient.
  • Add apiFetch unit tests covering retry behavior, non-retryable 4xx, exhaustion behavior, and timeout aborts.
  • Add vitest + a test script to @argos-ci/api-client (and update the lockfile accordingly).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Adds Vitest entry for the api-client workspace importer.
packages/api-client/src/index.ts Uses shared apiFetch implementation and re-exports APIError.
packages/api-client/src/fetch.ts Introduces apiFetch with request recreation, retries, and timeout support.
packages/api-client/src/fetch.test.ts Adds Vitest coverage for retry, body replay, and timeout behavior.
packages/api-client/package.json Adds vitest devDependency and a test script.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api-client/src/fetch.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@gregberge gregberge merged commit cc33873 into main May 20, 2026
68 checks passed
@gregberge gregberge deleted the improve-api-client branch May 20, 2026 15:01
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