From 666898fc6fefd2c785d9294b9752e1a1548a74ad Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:27:21 -0400 Subject: [PATCH] Don't increment messageId for custom ping messages (backport #2493) (#2497) Co-authored-by: dydxwill <119354122+dydxwill@users.noreply.github.com> --- indexer/services/socks/src/websocket/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indexer/services/socks/src/websocket/index.ts b/indexer/services/socks/src/websocket/index.ts index 795f6a7527..1906d3a72e 100644 --- a/indexer/services/socks/src/websocket/index.ts +++ b/indexer/services/socks/src/websocket/index.ts @@ -243,8 +243,6 @@ export class Index { return; } - this.connections[connectionId].messageId += 1; - const messageStr = message.toString(); let parsed: IncomingMessage; @@ -282,6 +280,8 @@ export class Index { messageContents: safeJsonStringify(message), }); + this.connections[connectionId].messageId += 1; + // Do not wait for this. this.subscriptions.subscribe( this.connections[connectionId].ws, @@ -311,6 +311,8 @@ export class Index { unsubscribeMessage.id, ); + this.connections[connectionId].messageId += 1; + sendMessage( this.connections[connectionId].ws, connectionId,