From 6c057dbaa5b2b7b91bb373352c25ecea98342e4e Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Wed, 16 Sep 2026 22:42:29 -0700 Subject: [PATCH] test(desktop): the no-heartbeat check expects the capability advertisement Same stale invariant the ui-tui test had: since the shared channel sends one client.capabilities frame on every gateway.ready, "no frames" is no longer what this case guards. What it guards is that an older backend without heartbeat gets no gateway.ping and stays open, so assert the wire holds exactly the advertisement. --- apps/desktop/src/lib/json-rpc-gateway-heartbeat.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/lib/json-rpc-gateway-heartbeat.test.ts b/apps/desktop/src/lib/json-rpc-gateway-heartbeat.test.ts index 5d9f8b18a5..549334b027 100644 --- a/apps/desktop/src/lib/json-rpc-gateway-heartbeat.test.ts +++ b/apps/desktop/src/lib/json-rpc-gateway-heartbeat.test.ts @@ -126,6 +126,9 @@ describe('JsonRpcGatewayClient heartbeat recovery', () => { await vi.advanceTimersByTimeAsync(1_000) expect(client.connectionState).toBe('open') expect(socket.readyState).toBe(FakeSocket.OPEN) - expect(socket.sent).toEqual([]) + // The one frame on the wire is the client.capabilities advertisement every gateway.ready triggers. + const methods = socket.sent.map(text => (JSON.parse(text) as { method: string }).method) + + expect(methods).toEqual(['client.capabilities']) }) })