Skip to content

Commit e1cee80

Browse files
travisbreaksclaude
andcommitted
fix: restart periodic ping after client reconnection
The reconnection path (when transport.sessionId is set) returns early, skipping the startPeriodicPing() call that runs after normal initialization. Since _onclose() clears the ping timer during disconnection, connection health monitoring silently stops working after any reconnect. Adding startPeriodicPing() before the early return ensures pings resume on reconnection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 810c72e commit e1cee80

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/client/src/client/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ export class Client extends Protocol<ClientContext> {
498498
if (this._negotiatedProtocolVersion !== undefined && transport.setProtocolVersion) {
499499
transport.setProtocolVersion(this._negotiatedProtocolVersion);
500500
}
501+
// Restart periodic ping since _onclose() clears the timer on disconnect
502+
this.startPeriodicPing();
501503
return;
502504
}
503505
try {

0 commit comments

Comments
 (0)