fix(FN-730): add missing ping handler in useTerminal WebSocket hook
- Add ping/pong heartbeat handler to useTerminal WebSocket hook - Add tests for WebSocket heartbeat ping/pong behavior - Remove unused usage tracking module and its tests - Simplify usage.ts by removing dead code
This commit is contained in:
@@ -199,6 +199,11 @@ export function useTerminal(sessionId: string | null): UseTerminalReturn {
|
||||
onExitCallbacksRef.current.forEach((cb) => cb(msg.exitCode!));
|
||||
}
|
||||
break;
|
||||
case "ping":
|
||||
if (ws.readyState === WebSocket.OPEN) {
|
||||
ws.send(JSON.stringify({ type: "pong" }));
|
||||
}
|
||||
break;
|
||||
case "pong":
|
||||
// Heartbeat response
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user