From b6b20455e44ce0d8806c0b8d474d622d245dbdfd Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 05:58:03 +0000 Subject: [PATCH] Cover binary websocket request payloads in smoke test Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index d39cd7aa06..76d1dcb6f9 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -1597,6 +1597,49 @@ async function main() { }); }); + await new Promise((resolve, reject) => { + const timer = setTimeout( + () => reject(new Error("Smoke test failed: binary websocket app.health request timed out.")), + 20_000, + ); + const onMessage = (event) => { + let message; + try { + message = JSON.parse(String(event.data)); + } catch { + return; + } + + if (message.type !== "response" || message.id !== "smoke-binary-health") { + return; + } + if ( + message.ok !== true || + message.result?.status !== "ok" || + message.result?.launchCwd !== appRoot + ) { + clearTimeout(timer); + ws.removeEventListener("message", onMessage); + reject(new Error("Smoke test failed: binary websocket app.health response mismatch.")); + return; + } + + clearTimeout(timer); + ws.removeEventListener("message", onMessage); + resolve(); + }; + + ws.addEventListener("message", onMessage); + const encodedBinaryRequest = new TextEncoder().encode( + JSON.stringify({ + type: "request", + id: "smoke-binary-health", + method: "app.health", + }), + ); + ws.send(encodedBinaryRequest); + }); + const bootstrapResponse = await sendWsRequest(ws, { id: "smoke-bootstrap", method: "app.bootstrap",