From 9a3f96c4590d06983a1e5412ce96cb6b2e6f9f87 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Fri, 7 Feb 2025 12:17:34 -0800 Subject: [PATCH] fix(sdk-js): Remove default fetch timeout --- libs/sdk-js/src/client.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/sdk-js/src/client.ts b/libs/sdk-js/src/client.ts index ed679ae04..d7f0c42b3 100644 --- a/libs/sdk-js/src/client.ts +++ b/libs/sdk-js/src/client.ts @@ -78,7 +78,7 @@ interface ClientConfig { class BaseClient { protected asyncCaller: AsyncCaller; - protected timeoutMs: number; + protected timeoutMs: number | undefined; protected apiUrl: string; @@ -91,7 +91,7 @@ class BaseClient { ...config?.callerOptions, }); - this.timeoutMs = config?.timeoutMs || 12_000; + this.timeoutMs = config?.timeoutMs; // default limit being capped by Chrome // https://github.com/nodejs/undici/issues/1373 @@ -131,7 +131,7 @@ class BaseClient { if (options.timeoutMs != null) { timeoutSignal = AbortSignal.timeout(options.timeoutMs); } - } else { + } else if (this.timeoutMs != null) { timeoutSignal = AbortSignal.timeout(this.timeoutMs); }