From 573d8a0e109f260b14fb41f09d742a4a861707bf Mon Sep 17 00:00:00 2001 From: DmitryAnansky Date: Mon, 27 Apr 2026 14:02:50 +0300 Subject: [PATCH] fix: increase default fetch timeout for push command --- .changeset/six-bobcats-draw.md | 5 +++++ packages/cli/src/reunite/api/api-client.ts | 3 +-- packages/cli/src/utils/fetch-with-timeout.ts | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/six-bobcats-draw.md diff --git a/.changeset/six-bobcats-draw.md b/.changeset/six-bobcats-draw.md new file mode 100644 index 0000000000..7ecd2d78d6 --- /dev/null +++ b/.changeset/six-bobcats-draw.md @@ -0,0 +1,5 @@ +--- +"@redocly/cli": patch +--- + +Increased the default fetch timeout used by the `push` command to better support slower uploads. diff --git a/packages/cli/src/reunite/api/api-client.ts b/packages/cli/src/reunite/api/api-client.ts index a60f3fc7cd..b85e19efa3 100644 --- a/packages/cli/src/reunite/api/api-client.ts +++ b/packages/cli/src/reunite/api/api-client.ts @@ -2,7 +2,6 @@ import { yellow, red } from 'colorette'; import fetchWithTimeout, { type FetchWithTimeoutOptions, DEFAULT_FETCH_TIMEOUT, - SOURCE_FETCH_TIMEOUT, } from '../../utils/fetch-with-timeout'; import type { ReadStream } from 'fs'; @@ -110,7 +109,7 @@ class RemotesApi { const response = await this.client.request( `${this.domain}/api/orgs/${organizationId}/projects/${projectId}/source`, { - timeout: SOURCE_FETCH_TIMEOUT, + timeout: DEFAULT_FETCH_TIMEOUT, method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/packages/cli/src/utils/fetch-with-timeout.ts b/packages/cli/src/utils/fetch-with-timeout.ts index 64c2b6a6b4..e7671ab5da 100644 --- a/packages/cli/src/utils/fetch-with-timeout.ts +++ b/packages/cli/src/utils/fetch-with-timeout.ts @@ -1,7 +1,6 @@ import { getProxyAgent } from '@redocly/openapi-core'; -export const DEFAULT_FETCH_TIMEOUT = 3000; -export const SOURCE_FETCH_TIMEOUT = 6000; +export const DEFAULT_FETCH_TIMEOUT = 6000; export type FetchWithTimeoutOptions = RequestInit & { timeout?: number;