From d2ab94be66c6da7aedc6809374a93967ba66d7ab Mon Sep 17 00:00:00 2001 From: Tyagiquamar Date: Fri, 2 Oct 2026 14:47:10 +0530 Subject: [PATCH] Send echo=true connection param by default (RTC1a) Per spec RTC1a, the echoMessages option (default true) is sent as the echo query parameter on the WebSocket connection URL. Previously only echo=false was sent when explicitly disabled; the default sent no param. --- src/common/lib/transport/connectionmanager.ts | 4 +--- test/uts/deviations.md | 10 ---------- test/uts/realtime/unit/client/realtime_client.test.ts | 1 - 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/common/lib/transport/connectionmanager.ts b/src/common/lib/transport/connectionmanager.ts index bbf2eb5400..d9e02f03da 100644 --- a/src/common/lib/transport/connectionmanager.ts +++ b/src/common/lib/transport/connectionmanager.ts @@ -78,9 +78,7 @@ export class TransportParams { if (options.clientId !== undefined) { params.clientId = options.clientId; } - if (options.echoMessages === false) { - params.echo = 'false'; - } + params.echo = options.echoMessages === false ? 'false' : 'true'; if (this.format !== undefined) { params.format = this.format; } diff --git a/test/uts/deviations.md b/test/uts/deviations.md index a8d39d32c2..c54b4e36bf 100644 --- a/test/uts/deviations.md +++ b/test/uts/deviations.md @@ -8,16 +8,6 @@ Tests marked with `if (!process.env.RUN_DEVIATIONS) this.skip()` are skipped by These tests assert spec behavior but are skipped by default because they are known to fail. Run with `RUN_DEVIATIONS=1` to execute them. -### realtime_client: RTC1a - echoMessages default does not send echo=true - -**Spec (RTC1a)**: The `echoMessages` option (default true) should be sent as `echo=true` query parameter. - -**ably-js behavior**: ably-js only sends `echo=false` when `echoMessages` is explicitly false. When `echoMessages` is true (default), no `echo` parameter is sent — the server defaults to echoing. - -**Test**: `RTC1a - echoMessages default sends echo=true` — asserts `echo=true` per spec. - ---- - ### channel_detach: RTL5k - ATTACHED while detached does not send DETACH **Spec (RTL5k)**: If the channel receives an ATTACHED message while in the DETACHED state, it should send a new DETACH message. diff --git a/test/uts/realtime/unit/client/realtime_client.test.ts b/test/uts/realtime/unit/client/realtime_client.test.ts index 939de5c356..754d409c9d 100644 --- a/test/uts/realtime/unit/client/realtime_client.test.ts +++ b/test/uts/realtime/unit/client/realtime_client.test.ts @@ -95,7 +95,6 @@ describe('uts/realtime/unit/client/realtime_client', function () { */ // UTS: realtime/unit/RTC1a/echo-messages-option-0 it('RTC1a - echoMessages default sends echo=true', async function () { - if (!process.env.RUN_DEVIATIONS) this.skip(); // ably-js omits echo param when true let echoParam: string | null = null; const mock = new MockWebSocket({ onConnectionAttempt: (conn) => {