From e96d38a017fde8ed58e75e716c602b0af6772b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 18:51:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=80=81=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E7=BB=99=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=81=8F=E5=A5=BD=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E5=8A=A0=E8=B6=85=E6=97=B6=E5=9B=B4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AuthenticatedClient 的 hydrateClientServerSelection 改走 withAuthCheckTimeout,IPC 卡住时不再让界面无限停在「刷新登录状态」 --- .../ai-game-creator-shell/src/app/AuthenticatedClient.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx b/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx index dcb003db5..31c4e82b4 100644 --- a/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx +++ b/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx @@ -226,7 +226,13 @@ export function AuthenticatedClient({ try { // 服务器选择先于认证读取落盘值:Rust 按 `expectedApiBaseUrl` 判定凭据归属,竞态下用 // 渠道默认值会被当成「凭据属于另一个 origin」而误报未登录,自定义服务器每次启动都要重登。 - const selection = await hydrateClientServerSelection(); + // 读服务器偏好同样是一次 IPC:不设围栏时,它卡住会让界面永远停在「刷新登录状态」, + // 既没有超时提示也没有重试路径(`hydrateClientServerSelection` 自己吞错、不会 reject)。 + const selection = await withAuthCheckTimeout( + hydrateClientServerSelection(), + AUTH_CHECK_REQUEST_TIMEOUT_MS, + '读取服务器偏好超时,请重试或重启客户端', + ); if (!isActiveRun()) return; setServerSelection(selection); setCustomServerUrl(selection.customBaseUrl);