-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This partially restores the fix from c9cf2b7 that was removed during the addition of new group consistency at de63527 but only for "Member added" messages. Multiple "Member added" messages happen when the same QR code is processed multiple times by multiple devices.
- Loading branch information
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5049,6 +5049,32 @@ async fn test_unarchive_on_member_removal() -> Result<()> { | |
Ok(()) | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_no_op_member_added_is_trash() -> Result<()> { | ||
let mut tcm = TestContextManager::new(); | ||
let alice = &tcm.alice().await; | ||
let bob = &tcm.bob().await; | ||
let alice_chat_id = alice | ||
.create_group_with_members(ProtectionStatus::Unprotected, "foos", &[bob]) | ||
.await; | ||
send_text_msg(alice, alice_chat_id, "populate".to_string()).await?; | ||
let msg = alice.pop_sent_msg().await; | ||
bob.recv_msg(&msg).await; | ||
let bob_chat_id = bob.get_last_msg().await.chat_id; | ||
bob_chat_id.accept(bob).await?; | ||
|
||
let fiona_id = Contact::create(alice, "", "[email protected]").await?; | ||
add_contact_to_chat(alice, alice_chat_id, fiona_id).await?; | ||
let msg = alice.pop_sent_msg().await; | ||
|
||
let fiona_id = Contact::create(bob, "", "[email protected]").await?; | ||
add_contact_to_chat(bob, bob_chat_id, fiona_id).await?; | ||
bob.recv_msg_trash(&msg).await; | ||
let contacts = get_chat_contacts(bob, bob_chat_id).await?; | ||
assert_eq!(contacts.len(), 3); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_forged_from() -> Result<()> { | ||
let mut tcm = TestContextManager::new(); | ||
|