Skip to content

Commit

Permalink
Don't increment messageId for custom ping messages (backport #2493) (#…
Browse files Browse the repository at this point in the history
…2498)

Co-authored-by: dydxwill <[email protected]>
  • Loading branch information
mergify[bot] and dydxwill authored Oct 16, 2024
1 parent 212a015 commit 21cc9b9
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 21cc9b9

Please sign in to comment.