From c74f48b62e7005ef6894f2740afbbf0743b78432 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 26 Jul 2026 21:03:27 -0500 Subject: [PATCH] fix(desktop): null-guard the rotation signal fired from ensureSessionState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The salvaged no-op-publish guard moved the compression-rotation signal into ensureSessionState, where storedSessionId is string|null. A cleared stored id is a detach, not a rotation — firing the event with a null next id would send the route-follow effect chasing nothing (and tsc rejects it). Guard on a real next id. --- apps/desktop/src/app/session/hooks/use-session-state-cache.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/app/session/hooks/use-session-state-cache.ts b/apps/desktop/src/app/session/hooks/use-session-state-cache.ts index 952c90be799e..04fe08513e57 100644 --- a/apps/desktop/src/app/session/hooks/use-session-state-cache.ts +++ b/apps/desktop/src/app/session/hooks/use-session-state-cache.ts @@ -118,7 +118,9 @@ export function useSessionStateCache({ if (existing.storedSessionId && existing.storedSessionId !== storedSessionId) { runtimeIdByStoredSessionIdRef.current.delete(existing.storedSessionId) - if (sessionId === $activeSessionId.get()) { + // A rotation event needs a real next id — a null/cleared stored id + // is a detach, not a rotation the route-follow effect should chase. + if (storedSessionId && sessionId === $activeSessionId.get()) { setActiveSessionStoredIdRotation({ nextStoredSessionId: storedSessionId, previousStoredSessionId: existing.storedSessionId,