{"record":{"id":"cd1443a6fd684e19","repo":"ruvnet/ruflo","slug":"client-heartbeat-timeout-cd1443","errorCode":null,"errorMessage":"Client heartbeat timeout","messagePattern":"Client heartbeat timeout","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/mcp/transport/websocket.ts","lineNumber":478,"sourceCode":"    if (this.config.enableBinaryMode) {\n      // Could implement binary protocol here\n      return JSON.stringify(message);\n    }\n    return JSON.stringify(message);\n  }\n\n  /**\n   * Start heartbeat interval\n   */\n  private startHeartbeat(): void {\n    const interval = this.config.heartbeatInterval || 30000; // 30 seconds\n    const timeout = this.config.heartbeatTimeout || 10000; // 10 seconds\n\n    this.heartbeatTimer = setInterval(() => {\n      for (const client of this.clients.values()) {\n        if (!client.isAlive) {\n          // Client didn't respond to last ping\n          this.logger.warn('Client heartbeat timeout', { id: client.id });\n          client.ws.terminate();\n          this.clients.delete(client.id);\n          continue;\n        }\n\n        client.isAlive = false;\n        try {\n          client.ws.ping();\n        } catch {\n          // Ignore ping errors\n        }\n      }\n    }, interval);\n  }\n\n  /**\n   * Stop heartbeat interval\n   */","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/mcp/transport/websocket.ts#L460-L496","documentation":"The heartbeat interval found a client whose isAlive flag was still false after the last ping — it never sent a pong within heartbeatTimeout. The server logs the timeout and disconnects the dead client (standard WS liveness reaping), freeing its connection slot.","triggerScenarios":"WebSocket client fails to respond to heartbeat pings within the timeout; dead peer, suspended browser tab, or broken network path; server closes and cleans up the connection.","commonSituations":"See trigger scenarios.","solutions":["Verify the client sends heartbeat/ping frames within the configured interval.","Increase the heartbeat timeout for high-latency clients.","Check for client-side event-loop stalls delaying heartbeats, and ensure reconnect logic recovers the socket."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}