Skip to content

Commit

Permalink
Don't increment messageId for custom ping messages (#2493)
Browse files Browse the repository at this point in the history
(cherry picked from commit 40e16b4)
  • Loading branch information
dydxwill authored and mergify[bot] committed Oct 16, 2024
1 parent 54b3bce commit 3c2db0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions indexer/services/socks/src/websocket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ export class Index {
return;
}

this.connections[connectionId].messageId += 1;

const messageStr = message.toString();

let parsed: IncomingMessage;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -311,6 +311,8 @@ export class Index {
unsubscribeMessage.id,
);

this.connections[connectionId].messageId += 1;

sendMessage(
this.connections[connectionId].ws,
connectionId,
Expand Down

0 comments on commit 3c2db0c

Please sign in to comment.