fix(webui): retain temporary chat state across navigation

This commit is contained in:
Xubin Ren committed 2026-09-21 16:45:30 +08:00
1 parent 7a317c3968
commit bfb5129e6f
6 files changed
+370 -5

No files matched your search

+4
View File
@@ -1300,6 +1300,10 @@ export class NanobotClient {
this.pendingInboundByChat.set(chatId, q);
}
q.push(ev);
// Temporary chats have no canonical history to recover evicted events from.
// Like their pinned message snapshots, retain them until resubscribe, close
// or disconnect. Disk-backed chats keep the bounded replay tail below.
if (this.temporaryChatIds.has(chatId)) return;
const over = q.length - NanobotClient.PENDING_INBOUND_MAX;
if (over > 0) {
q.splice(0, over);