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:
gsxdsm
2026-04-02 19:12:24 -07:00
parent 30f6413e15
commit ddf06bb7cf
2 changed files with 58 additions and 0 deletions

View File

@@ -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;