From 3c2db0cb1a6ca1c29a8abcd4f3cb18b7ba22456e Mon Sep 17 00:00:00 2001 From: dydxwill <119354122+dydxwill@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:25:54 -0400 Subject: [PATCH] Don't increment messageId for custom ping messages (#2493) (cherry picked from commit 40e16b42fc23a473b3700440f1d9163e7d4cac7d) --- 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,