fix(desktop): null-guard the rotation signal fired from ensureSessionState

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.
This commit is contained in:
Brooklyn Nicholson 2026-07-26 21:03:27 -05:00
parent 9aaabdcbf4
commit c74f48b62e

View file

@ -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,