From e8d5660bae1db35182a35e03e564be0b584ebedc Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 24 Aug 2026 00:10:09 -0700 Subject: [PATCH] fix(desktop): bound the boot and gateway-switch resolveGatewayWsUrl awaits too (#93454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to the reconnect-loop fix: the same unbounded ticket-mint await exists on the soft gateway-switch path and the initial boot() path. Bound both with the same withTimeout/RECONNECT_ATTEMPT_TIMEOUT_MS so a wedged IPC round-trip fails into the existing retry paths instead of hanging the switch or the 'Starting Hermes…' screen forever. --- .../src/app/gateway/hooks/use-gateway-boot.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts index 2baff83a96..20174af6a3 100644 --- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts +++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts @@ -500,7 +500,13 @@ export function useGatewayBoot({ } publish(conn) - const wsUrl = await resolveGatewayWsUrl(desktop, conn) + // Bounded for the same reason as attemptReconnect() (#93454): a wedged + // ticket mint would otherwise hang the gateway switch forever. + const wsUrl = await withTimeout( + resolveGatewayWsUrl(desktop, conn), + RECONNECT_ATTEMPT_TIMEOUT_MS, + 'Timed out re-minting the gateway WebSocket URL' + ) await gateway.connect(wsUrl) if (cancelled) { @@ -785,8 +791,14 @@ export function useGatewayBoot({ // ticket is single-use with a short TTL, so the ticket baked into // conn.wsUrl is stale; resolveGatewayWsUrl() re-mints it rather than // connecting with a dead ticket. Auth rejection asks for sign-in; - // connectivity failures remain retryable. - const wsUrl = await resolveGatewayWsUrl(desktop, conn) + // connectivity failures remain retryable. Bounded like the reconnect + // path (#93454) so a wedged mint fails into boot retry instead of + // hanging "Starting Hermes…" forever. + const wsUrl = await withTimeout( + resolveGatewayWsUrl(desktop, conn), + RECONNECT_ATTEMPT_TIMEOUT_MS, + 'Timed out minting the gateway WebSocket URL' + ) await gateway.connect(wsUrl) if (cancelled) {