web: fix auth session races, ws token drift, and unread clear behavior
Some checks failed
CI / test (push) Failing after 2m20s

This commit is contained in:
Codex
2026-03-09 02:17:14 +03:00
parent 4fa657ff7a
commit ad2e0ede42
6 changed files with 96 additions and 12 deletions

View File

@@ -160,7 +160,7 @@ export function useRealtime() {
window.dispatchEvent(new CustomEvent("bm:chat-updated", { detail: { chatId } }));
scheduleReloadChats();
if (chatStore.activeChatId === chatId || (chatStore.messagesByChat[chatId]?.length ?? 0) > 0) {
void chatStore.loadMessages(chatId);
void chatStore.loadMessages(chatId, { markRead: false });
}
}
}
@@ -398,7 +398,7 @@ export function useRealtime() {
uniqueChatIds.add(storeAfter.activeChatId);
}
for (const chatId of uniqueChatIds) {
await storeAfter.loadMessages(chatId);
await storeAfter.loadMessages(chatId, { markRead: false });
}
}