From f3a1e40fceddcacb9d7e9f5fb307b4005825bcd9 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 9 Feb 2026 23:47:26 +0000 Subject: [PATCH] Use WebSocket.OPEN constant for runtime send guard Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/t3/src/runtimeApiServer.ts b/apps/t3/src/runtimeApiServer.ts index 131d85484f..d26f9e2746 100644 --- a/apps/t3/src/runtimeApiServer.ts +++ b/apps/t3/src/runtimeApiServer.ts @@ -2,7 +2,7 @@ import { spawn } from "node:child_process"; import os from "node:os"; import path from "node:path"; import { z } from "zod"; -import { WebSocketServer, type RawData, type WebSocket } from "ws"; +import { WebSocket, WebSocketServer, type RawData } from "ws"; import { EDITORS, @@ -137,7 +137,7 @@ function responseError(id: string, error: JsonRpcErrorResult): WsResponseMessage } function sendMessage(socket: WebSocket, message: unknown): void { - if (socket.readyState !== socket.OPEN) { + if (socket.readyState !== WebSocket.OPEN) { return; }