diff --git a/src/cli/gateway-cli.ts b/src/cli/gateway-cli.ts index dedbde667..65e054e19 100644 --- a/src/cli/gateway-cli.ts +++ b/src/cli/gateway-cli.ts @@ -79,7 +79,9 @@ export function registerGatewayCli(program: Command) { wsLogRaw !== "compact" && wsLogRaw !== "full" ) { - defaultRuntime.error('Invalid --ws-log (use "auto", "full", "compact")'); + defaultRuntime.error( + 'Invalid --ws-log (use "auto", "full", "compact")', + ); defaultRuntime.exit(1); } setGatewayWsLogStyle(wsLogStyle); diff --git a/src/gateway/server.ts b/src/gateway/server.ts index a8ad93417..ca2ad7470 100644 --- a/src/gateway/server.ts +++ b/src/gateway/server.ts @@ -90,10 +90,6 @@ import { setHeartbeatsEnabled } from "../web/auto-reply.js"; import { sendMessageWhatsApp } from "../web/outbound.js"; import { requestReplyHeartbeatNow } from "../web/reply-heartbeat-wake.js"; import { buildMessageWithAttachments } from "./chat-attachments.js"; -import { - DEFAULT_WS_SLOW_MS, - getGatewayWsLogStyle, -} from "./ws-logging.js"; import { type ConnectParams, ErrorCodes, @@ -131,6 +127,7 @@ import { validateSessionsPatchParams, validateWakeParams, } from "./protocol/index.js"; +import { DEFAULT_WS_SLOW_MS, getGatewayWsLogStyle } from "./ws-logging.js"; type Client = { socket: WebSocket; @@ -606,7 +603,9 @@ function logWsOptimized( if (direction !== "out" || kind !== "res") return; - const startedAt = inflightKey ? wsInflightOptimized.get(inflightKey) : undefined; + const startedAt = inflightKey + ? wsInflightOptimized.get(inflightKey) + : undefined; if (inflightKey) wsInflightOptimized.delete(inflightKey); const durationMs = typeof startedAt === "number" ? Date.now() - startedAt : undefined; @@ -694,7 +693,9 @@ function logWsCompact( wsInflightCompact.delete(inflightKey); } const durationToken = - typeof startedAt === "number" ? chalk.dim(`${now - startedAt}ms`) : undefined; + typeof startedAt === "number" + ? chalk.dim(`${now - startedAt}ms`) + : undefined; const headline = (kind === "req" || kind === "res") && method