From 6d112c89c546d60fff79b3c3a4cf87d98722ba90 Mon Sep 17 00:00:00 2001 From: Daniel Rochetti Date: Mon, 26 Feb 2024 14:28:50 -0800 Subject: [PATCH] fix: connection timeout error (#55) --- libs/client/package.json | 2 +- libs/client/src/realtime.ts | 6 ++++++ libs/client/tsconfig.lib.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/client/package.json b/libs/client/package.json index b06d935..175d82c 100644 --- a/libs/client/package.json +++ b/libs/client/package.json @@ -1,7 +1,7 @@ { "name": "@fal-ai/serverless-client", "description": "The fal serverless JS/TS client", - "version": "0.8.5", + "version": "0.8.6", "license": "MIT", "repository": { "type": "git", diff --git a/libs/client/src/realtime.ts b/libs/client/src/realtime.ts index 07eda66..e6351fb 100644 --- a/libs/client/src/realtime.ts +++ b/libs/client/src/realtime.ts @@ -520,6 +520,12 @@ export const realtimeImpl: RealtimeClient = { return; } if (isFalErrorResult(data)) { + if (data.error === 'TIMEOUT') { + // Timeout error messages just indicate that the connection hasn't + // received an incoming message for a while. We don't need to + // handle them as errors. + return; + } const { onError = noop } = getCallbacks(); onError( new ApiError({ diff --git a/libs/client/tsconfig.lib.json b/libs/client/tsconfig.lib.json index c595e07..f70d31f 100644 --- a/libs/client/tsconfig.lib.json +++ b/libs/client/tsconfig.lib.json @@ -6,6 +6,7 @@ "inlineSources": true, "declaration": true, "esModuleInterop": true, + "importHelpers": false, "allowJs": true, "checkJs": false, "types": ["node"]