From a13a6012e151c63f524b3589c0ea6c7156c34b3c Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 24 Apr 2026 06:01:59 +0700 Subject: [PATCH] chore(lint): no-explicit-any in relay-transport.e2e.test --- .../daemon-e2e/relay-transport.e2e.test.ts | 64 ++++++++++++++++--- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/packages/server/src/server/daemon-e2e/relay-transport.e2e.test.ts b/packages/server/src/server/daemon-e2e/relay-transport.e2e.test.ts index 6241d75783..99acde67af 100644 --- a/packages/server/src/server/daemon-e2e/relay-transport.e2e.test.ts +++ b/packages/server/src/server/daemon-e2e/relay-transport.e2e.test.ts @@ -259,9 +259,24 @@ async function waitForRelayWebSocketReady(port: number, timeout = 60000): Promis if ( payload && typeof payload === "object" && - (payload as any).type === "session" && - (payload as any).message?.type === "status" && - (payload as any).message?.payload?.status === "server_info" + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).type === "session" && + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).message?.type === "status" && + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).message?.payload?.status === "server_info" ) { if (!pingSent && channelRef) { pingSent = true; @@ -269,7 +284,16 @@ async function waitForRelayWebSocketReady(port: number, timeout = 60000): Promis } return; } - if (payload && typeof payload === "object" && (payload as any).type === "pong") { + if ( + payload && + typeof payload === "object" && + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).type === "pong" + ) { clearTimeout(timeout); resolve(payload); ws.close(); @@ -388,9 +412,24 @@ async function waitForRelayWebSocketReady(port: number, timeout = 60000): Promis if ( payload && typeof payload === "object" && - (payload as any).type === "session" && - (payload as any).message?.type === "status" && - (payload as any).message?.payload?.status === "server_info" + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).type === "session" && + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).message?.type === "status" && + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).message?.payload?.status === "server_info" ) { if (!pingSent && channelRef) { pingSent = true; @@ -398,7 +437,16 @@ async function waitForRelayWebSocketReady(port: number, timeout = 60000): Promis } return; } - if (payload && typeof payload === "object" && (payload as any).type === "pong") { + if ( + payload && + typeof payload === "object" && + ( + payload as { + type?: string; + message?: { type?: string; payload?: { status?: string } }; + } + ).type === "pong" + ) { clearTimeout(timeout); resolve(payload); ws.close();