From cc6b1f299bd3a7c0309f003d97dc32014e71fa80 Mon Sep 17 00:00:00 2001 From: yoniebans Date: Mon, 19 Oct 2026 22:18:06 +0200 Subject: [PATCH] fix(desktop): an unhinted project-tree lookup reads the live gateway's profile --- apps/desktop/src/store/session-unread.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/store/session-unread.ts b/apps/desktop/src/store/session-unread.ts index 72bade6f5b..80085918b2 100644 --- a/apps/desktop/src/store/session-unread.ts +++ b/apps/desktop/src/store/session-unread.ts @@ -327,19 +327,18 @@ function resolveOwnedRow(storedSessionId: string, profile?: string): SessionInfo : resolveLoadedRow(storedSessionId) } -/** A project-tree row for *storedSessionId* (in *profile*'s bucket when one is named). */ +/** A project-tree row for *storedSessionId* in *profile*'s bucket, else the live gateway's (as the + * live-source lookup): the tree mixes profiles, and an unhinted completion comes from the live gateway. */ function projectTreeRow(storedSessionId: string, profile?: string): SessionInfo | undefined { + const owner = normalizeProfileKey(profile ?? $activeGatewayProfile.get()) + return $projectTree .get() .flatMap(project => [ ...(project.previewSessions ?? []), ...project.repos.flatMap(repo => repo.groups.flatMap(group => group.sessions)) ]) - .find( - row => - sessionMatchesStoredId(row, storedSessionId) && - (!profile || profileKeyForRow(row) === normalizeProfileKey(profile)) - ) + .find(row => sessionMatchesStoredId(row, storedSessionId) && profileKeyForRow(row) === owner) } /** Sources the live poll reported, by profile and stored id: a messaging turn can settle before its row