From d196983b5dc18298de49d05934617b68a4edbc8f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 4 Sep 2026 01:32:24 +0000 Subject: [PATCH] fix(desktop): observe foreground promotion failures Co-authored-by: Josh Tsai --- apps/desktop/src/store/gateway.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/desktop/src/store/gateway.ts b/apps/desktop/src/store/gateway.ts index bb0f819bce..4d864a4a5d 100644 --- a/apps/desktop/src/store/gateway.ts +++ b/apps/desktop/src/store/gateway.ts @@ -521,13 +521,17 @@ async function openSecondary(entry: Secondary, spawnPriority: SpawnPriority = 'b if (spawnPriority === 'foreground') { // Hydration may already own this dial as a background slot wait. Kick a // foreground IPC so main can promote it onto the reserved slot. - void (entry.connectionId && desktop.getConnectionFor - ? desktop.getConnectionFor({ - connectionId: entry.connectionId, - profile: entry.profile, - priority: 'foreground' - }) - : desktop.getConnection(entry.profile, { priority: 'foreground' })) + void ( + ( + entry.connectionId && desktop.getConnectionFor + ? desktop.getConnectionFor({ + connectionId: entry.connectionId, + profile: entry.profile, + priority: 'foreground' + }) + : desktop.getConnection(entry.profile, { priority: 'foreground' }) + ).catch(() => undefined) + ) } await entry.connectPromise