From 31481ddaae9d901814fe1a7b452962d593c3bbb0 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Sat, 6 Aug 2022 12:36:11 +0530 Subject: [PATCH] fix: Disable polling transport for RTS (#15773) Disable polling transport for RTS This is required to support clustering of RTS, and with it, the Appsmith server. --- app/client/src/sagas/WebsocketSagas/WebsocketSagas.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/client/src/sagas/WebsocketSagas/WebsocketSagas.ts b/app/client/src/sagas/WebsocketSagas/WebsocketSagas.ts index 836e923bea..3e9e10e166 100644 --- a/app/client/src/sagas/WebsocketSagas/WebsocketSagas.ts +++ b/app/client/src/sagas/WebsocketSagas/WebsocketSagas.ts @@ -36,6 +36,10 @@ import { SOCKET_CONNECTION_EVENTS } from "./socketEvents"; function connect(namespace?: string) { const options = { path: RTS_BASE_PATH, + // The default transports is ["polling", "websocket"], so polling is tried first. But polling + // needs sticky session to be turned on, in a clustered environment, even for it to upgrade to websockets. + // Ref: . + transports: ["websocket"], }; const socket = !!namespace ? io(namespace, options) : io(options);