@@ -4273,8 +4273,9 @@ async fn test_delayed_removal_is_ignored() -> Result<()> {
4273
4273
4274
4274
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
4275
4275
async fn test_dont_readd_with_normal_msg ( ) -> Result < ( ) > {
4276
- let alice = TestContext :: new_alice ( ) . await ;
4277
- let bob = TestContext :: new_bob ( ) . await ;
4276
+ let mut tcm = TestContextManager :: new ( ) ;
4277
+ let alice = tcm. alice ( ) . await ;
4278
+ let bob = tcm. bob ( ) . await ;
4278
4279
4279
4280
let alice_chat_id = create_group_chat ( & alice, ProtectionStatus :: Unprotected , "Group" ) . await ?;
4280
4281
@@ -4289,6 +4290,7 @@ async fn test_dont_readd_with_normal_msg() -> Result<()> {
4289
4290
let bob_chat_id = bob. recv_msg ( & alice. pop_sent_msg ( ) . await ) . await . chat_id ;
4290
4291
bob_chat_id. accept ( & bob) . await ?;
4291
4292
4293
+ // Bob leaves, but Alice didn't receive Bob's leave message.
4292
4294
remove_contact_from_chat ( & bob, bob_chat_id, ContactId :: SELF ) . await ?;
4293
4295
bob. pop_sent_msg ( ) . await ;
4294
4296
assert_eq ! ( get_chat_contacts( & bob, bob_chat_id) . await ?. len( ) , 1 ) ;
@@ -4302,12 +4304,11 @@ async fn test_dont_readd_with_normal_msg() -> Result<()> {
4302
4304
. await ?;
4303
4305
bob. recv_msg ( & alice. pop_sent_msg ( ) . await ) . await ;
4304
4306
4305
- // Alice didn't receive Bob's leave message although a lot of time has
4306
- // passed, so Bob must re-add themselves otherwise other members would think
4307
- // Bob is still here while they aren't. Bob should retry to leave if they
4308
- // think that Alice didn't re-add them on purpose (which is possible if Alice uses a classical
4309
- // MUA).
4310
- assert ! ( is_contact_in_chat( & bob, bob_chat_id, ContactId :: SELF ) . await ?) ;
4307
+ // Bob received a message from Alice, but this should not re-add him to the group.
4308
+ assert ! ( !is_contact_in_chat( & bob, bob_chat_id, ContactId :: SELF ) . await ?) ;
4309
+
4310
+ // Bob got an update that fiora is added nevertheless.
4311
+ assert_eq ! ( get_chat_contacts( & bob, bob_chat_id) . await ?. len( ) , 2 ) ;
4311
4312
Ok ( ( ) )
4312
4313
}
4313
4314
0 commit comments