From fb868ad7b9ec22818aff41fcbceb90f5c15271e4 Mon Sep 17 00:00:00 2001 From: Osama Ansar Date: Fri, 11 Sep 2026 14:53:21 +0500 Subject: [PATCH] fix(connection): clarify timeout units are seconds, fix ms mislabel in REST timeout error TimeoutParams fields (query/insert/init) are configured in seconds throughout the codebase (see connection/grpc.ts, connection/config.ts) but were undocumented. The REST fetchWithTimeout error message also labeled the raw seconds value as milliseconds instead of converting it. Fixes #356 --- src/connection/http.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/connection/http.ts b/src/connection/http.ts index 471588e9..524832ba 100644 --- a/src/connection/http.ts +++ b/src/connection/http.ts @@ -32,11 +32,11 @@ export type ProxiesParams = { }; export type TimeoutParams = { - /** Define the configured timeout when querying data from Weaviate */ + /** Define the configured timeout, in seconds, when querying data from Weaviate */ query?: number; - /** Define the configured timeout when mutating data to Weaviate */ + /** Define the configured timeout, in seconds, when mutating data to Weaviate */ insert?: number; - /** Define the configured timeout when initially connecting to Weaviate */ + /** Define the configured timeout, in seconds, when initially connecting to Weaviate */ init?: number; }; @@ -249,7 +249,7 @@ const fetchWithTimeout = ( return fetch(input, { ...init, signal: controller.signal }) .catch((error) => { if (isAbortError(error)) { - throw new WeaviateRequestTimeoutError(`Request timed out after ${timeout}ms`); + throw new WeaviateRequestTimeoutError(`Request timed out after ${timeout * 1000}ms`); } throw error; // For other errors, rethrow them })