From 7a23dde6efff3079edeeda951fe0ee25516da833 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Wed, 18 Sep 2024 11:06:39 +0200 Subject: [PATCH] perf: do not reset the hearbeat timer on each packet This reverts https://github.com/socketio/socket.io/commit/ed34a45a0780b944a387c3a685d4f3af758cc2fa See also: https://github.com/socketio/engine.io/commit/5359bae683e2a25742bd4989d0355a8fc10d294e --- packages/engine.io-client/lib/socket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/engine.io-client/lib/socket.ts b/packages/engine.io-client/lib/socket.ts index 605f6aef7b..d663524ba4 100644 --- a/packages/engine.io-client/lib/socket.ts +++ b/packages/engine.io-client/lib/socket.ts @@ -574,7 +574,6 @@ export class SocketWithoutUpgrade extends Emitter< // Socket is live - any packet counts this.emitReserved("heartbeat"); - this._resetPingTimeout(); switch (packet.type) { case "open": @@ -585,6 +584,7 @@ export class SocketWithoutUpgrade extends Emitter< this._sendPacket("pong"); this.emitReserved("ping"); this.emitReserved("pong"); + this._resetPingTimeout(); break; case "error":