fix(chat): don't reload cached msgs on SESSION_RESUME ack

This commit is contained in:
M57 authored and GitHub committed 2026-06-20 00:54:16 +03:00
1 parent 0fabad820d
commit 61d49d2355
1 file changed
+5 -3
@@ -325,15 +325,17 @@ class ChatViewModel(
(resultMap?.get("session_id") as? String)
?: _uiState.value.currentSessionId
// B8 (Jun 20 2026, kanban t_session_resume): do NOT reload
// cached messages here — switchSession() already did so before
// the WS round-trip. Calling loadCachedMessages() here would
// overwrite any message the user sent between switchSession() and
// the server ack, making the chat appear to go blank.
_uiState.update {
it.copy(
isLoading = false,
currentSessionId = sessionId,
)
}
if (sessionId != null) {
loadCachedMessages(sessionId)
}
addSystemMessage("Session resumed")
}