mirror of
https://github.com/chatmail/core.git
synced 2026-05-17 05:46:30 +03:00
fix: When receiving MDN, mark all preceding messages as noticed, even having same timestamp (#7928)
This fixes flaky JSON-RPC `test_multidevice_sync_seen`.
This commit is contained in:
@@ -1010,11 +1010,11 @@ UPDATE config SET value=? WHERE keyname='configured_addr' AND value!=?1
|
|||||||
&& msg.chat_visibility == ChatVisibility::Archived;
|
&& msg.chat_visibility == ChatVisibility::Archived;
|
||||||
updated_chats
|
updated_chats
|
||||||
.entry(msg.chat_id)
|
.entry(msg.chat_id)
|
||||||
.and_modify(|ts| *ts = cmp::max(*ts, msg.timestamp_sort))
|
.and_modify(|pos| *pos = cmp::max(*pos, (msg.timestamp_sort, msg.id)))
|
||||||
.or_insert(msg.timestamp_sort);
|
.or_insert((msg.timestamp_sort, msg.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (chat_id, timestamp_sort) in updated_chats {
|
for (chat_id, (timestamp_sort, msg_id)) in updated_chats {
|
||||||
context
|
context
|
||||||
.sql
|
.sql
|
||||||
.execute(
|
.execute(
|
||||||
@@ -1023,12 +1023,13 @@ UPDATE msgs SET state=? WHERE
|
|||||||
state=? AND
|
state=? AND
|
||||||
hidden=0 AND
|
hidden=0 AND
|
||||||
chat_id=? AND
|
chat_id=? AND
|
||||||
timestamp<?",
|
(timestamp,id)<(?,?)",
|
||||||
(
|
(
|
||||||
MessageState::InNoticed,
|
MessageState::InNoticed,
|
||||||
MessageState::InFresh,
|
MessageState::InFresh,
|
||||||
chat_id,
|
chat_id,
|
||||||
timestamp_sort,
|
timestamp_sort,
|
||||||
|
msg_id,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user