The gateway replays the full transcript over a new socket on session.resume unless omit_messages is set; mobile hydrates history via REST in parallel, so the replay is redundant. When a reconnect lands mid-stream, the replayed message gets a fresh UUID and dedup can't collapse the 90% orphan with the 100% replay (different ids + content), leaving a duplicate bubble. Desktop already sends omit_messages: true; mirror that in both resume paths (ChatViewModel + NotificationReplyReceiver) and pin it in the exact-map test verifies. Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
1f0916ad05
commit
e854559de4
4 files changed
+16
-6
No files matched your search
@@ -128,7 +128,7 @@ open class NotificationReplyReceiver : BroadcastReceiver() {
|
||||
HermesWsClient
|
||||
.request(
|
||||
WsMethods.SESSION_RESUME,
|
||||
mapOf("session_id" to storedSessionId),
|
||||
mapOf("session_id" to storedSessionId, "omit_messages" to true),
|
||||
timeoutMs = REPLY_TIMEOUT_MS,
|
||||
).await() as? Map<*, *>
|
||||
val runtimeSessionId =
|
||||
|
||||
@@ -1952,7 +1952,7 @@ class ChatViewModel(
|
||||
viewModelScope.launch(ioDispatcher) {
|
||||
wsClient.send(
|
||||
WsMethods.SESSION_RESUME,
|
||||
mapOf("session_id" to sessionId),
|
||||
mapOf("session_id" to sessionId, "omit_messages" to true),
|
||||
onSent = { id ->
|
||||
trackSessionRequest(
|
||||
id = id,
|
||||
|
||||
Reference in new issue
Block a user