diff --git a/package-lock.json b/package-lock.json index 0e08bc5..ac2c33b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ulms/api-clients", - "version": "7.4.1", + "version": "7.4.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ulms/api-clients", - "version": "7.4.1", + "version": "7.4.2", "license": "MIT", "dependencies": { "axios": "1.6.2", diff --git a/package.json b/package.json index 78e743a..474c222 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ulms/api-clients", - "version": "7.4.1", + "version": "7.4.2", "description": "JavaScript API clients for ULMS platform", "keywords": [], "homepage": "https://github.com/foxford/ulms-api-clients-js#readme", diff --git a/src/error.js b/src/error.js index 7b83aea..6b35956 100644 --- a/src/error.js +++ b/src/error.js @@ -34,25 +34,12 @@ export class PresenceError extends Error { this.name = 'PresenceError' } - static get kinds() { - return { - RECOVERABLE_SESSION_ERROR: 'recoverable_session_error', - UNRECOVERABLE_SESSION_ERROR: 'unrecoverable_session_error', - } - } - static get recoverableTypes() { return { KEEP_ALIVE_TIMED_OUT: 'KEEP_ALIVE_TIMED_OUT', // client-side error - PING_TIMED_OUT: 'PING_TIMED_OUT', // client-side error // todo: remove it - - // slow_subscriber -> slow_consumer - SLOW_SUBSCRIBER: 'SLOW_SUBSCRIBER', // todo: remove it - SLOW_CONSUMER: 'SLOW_CONSUMER', - - // terminated -> server_shutdown - TERMINATED: 'TERMINATED', // todo: remove it SERVER_SHUTDOWN: 'SERVER_SHUTDOWN', + SLOW_CONSUMER: 'SLOW_CONSUMER', + WS_ERROR: 'WS_ERROR', // client-side error } } @@ -62,13 +49,10 @@ export class PresenceError extends Error { INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR', NOT_CONNECTED: 'NOT_CONNECTED', // client-side error - // replaced -> session_replaced - REPLACED: 'REPLACED', // todo: remove it SESSION_REPLACED: 'SESSION_REPLACED', SERIALIZATION_FAILED: 'SERIALIZATION_FAILED', UNKNOWN_ERROR: 'UNKNOWN_ERROR', // client-side error - WS_ERROR: 'WS_ERROR', // client-side error // currently unused and commented (todo: comment or remove) CONNECT_TIMEOUT: 'CONNECT_TIMEOUT', // ✅ @@ -87,12 +71,6 @@ export class PresenceError extends Error { return new PresenceError(errorType) } - static isRecoverableSessionError(error) { - const { type } = error - - return type === PresenceError.kinds.RECOVERABLE_SESSION_ERROR - } - static isReplacedError(error) { if (!(error instanceof PresenceError)) return false diff --git a/src/ws-transport.js b/src/ws-transport.js index 88d33ad..7b214c4 100644 --- a/src/ws-transport.js +++ b/src/ws-transport.js @@ -17,6 +17,7 @@ const KEEP_ALIVE_TIMED_OUT_ERROR_PAYLOAD = { } const WS_CLOSED_ERROR_PAYLOAD = { payload: { + is_transient: true, title: 'Connection closed', type: 'ws_error', },