From 09c5d759fa4696d6d3dfc74f9b678fa8a04bfd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Mon, 6 Apr 2026 00:18:22 +0100 Subject: [PATCH] fix(cli): rename duplicate setStatus to setConnStatus in BrokerClient The private setStatus(ConnStatus) conflicted with the public setStatus("idle"|"working"|"dnd") method, causing TS2393 under strict typecheck. Rename the private one to setConnStatus and update all internal call sites. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/cli/src/ws/client.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/cli/src/ws/client.ts b/apps/cli/src/ws/client.ts index 9e15540..d1c5a94 100644 --- a/apps/cli/src/ws/client.ts +++ b/apps/cli/src/ws/client.ts @@ -93,7 +93,7 @@ export class BrokerClient { /** Open WS, send hello, resolve when hello_ack received. */ async connect(): Promise { if (this.closed) throw new Error("client is closed"); - this.setStatus("connecting"); + this.setConnStatus("connecting"); const ws = new WebSocket(this.mesh.brokerUrl); this.ws = ws; @@ -146,7 +146,7 @@ export class BrokerClient { if (msg.type === "hello_ack") { if (this.helloTimer) clearTimeout(this.helloTimer); this.helloTimer = null; - this.setStatus("open"); + this.setConnStatus("open"); this.reconnectAttempt = 0; this.flushOutbound(); resolve(); @@ -163,7 +163,7 @@ export class BrokerClient { reject(new Error("ws closed before hello_ack")); } if (!this.closed) this.scheduleReconnect(); - else this.setStatus("closed"); + else this.setConnStatus("closed"); }; const onError = (err: Error): void => { @@ -277,7 +277,7 @@ export class BrokerClient { /* ignore */ } } - this.setStatus("closed"); + this.setConnStatus("closed"); } // --- Internals --- @@ -373,7 +373,7 @@ export class BrokerClient { } private scheduleReconnect(): void { - this.setStatus("reconnecting"); + this.setConnStatus("reconnecting"); const delay = BACKOFF_CAPS[Math.min(this.reconnectAttempt, BACKOFF_CAPS.length - 1)]!; this.reconnectAttempt += 1; @@ -388,7 +388,7 @@ export class BrokerClient { }, delay); } - private setStatus(s: ConnStatus): void { + private setConnStatus(s: ConnStatus): void { if (this._status === s) return; this._status = s; this.opts.onStatusChange?.(s);