From 50291a5e779af1ff814709595edf70653cfe62b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 19 Sep 2026 23:15:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=BF=87=E6=9C=9F=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E5=90=8E=E8=A1=A5=E8=B7=91=E8=A2=AB=E6=90=81=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=20consume?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts 在 consume 的 finally 之后补一次 consumeAgain 重排 - SUBSCRIPTION_EXPIRED 恢复期间到达的通知会因 consuming 仍为 true 只置位 consumeAgain,而 do/while 已因异常退出,原先这批事件要等下一次通知才会被消费 --- .../chat/controller/useDirectThreadChatSubscription.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts b/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts index 6434a03a3..90757bdce 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts @@ -117,6 +117,12 @@ export function useDirectThreadChatSubscription({ } finally { consuming = false; } + // 订阅过期恢复期间到达的通知只会把 consumeAgain 置位(此时 consuming 仍为 true), + // 而 do/while 已经因异常退出;这里补一次重排,否则这批事件要等下一次通知才被消费。 + if (!disposed && consumeAgain) { + consumeAgain = false; + void consume(); + } } async function bootstrap() { const result = await invoke(