fix: trash no-op addition messages

This partially restores the fix from c9cf2b7f2e
that was removed during the addition of new group consistency at de63527d94
but only for "Member added" messages.

Multiple "Member added" messages happen
when the same QR code is processed multiple times
by multiple devices.
This commit is contained in:
link2xt
2025-01-15 16:20:56 +00:00
committed by l
parent 3e7b662796
commit 498979c608
3 changed files with 39 additions and 4 deletions

View File

@@ -5301,8 +5301,8 @@ mod tests {
// Bob receives the add and deletion messages out of order
let bob = TestContext::new_bob().await;
bob.recv_msg(&add1).await;
bob.recv_msg(&add3).await;
let bob_chat_id = bob.recv_msg(&add2).await.chat_id;
let bob_chat_id = bob.recv_msg(&add3).await.chat_id;
bob.recv_msg_trash(&add2).await; // No-op addition message is trashed.
assert_eq!(get_chat_contacts(&bob, bob_chat_id).await?.len(), 4);
bob.recv_msg(&remove2).await;