@@ -4221,7 +4221,7 @@ async fn test_dont_recreate_contacts_on_add_remove() -> Result<()> {
4221
4221
}
4222
4222
4223
4223
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
4224
- async fn test_recreate_contact_list_on_missing_messages ( ) -> Result < ( ) > {
4224
+ async fn test_delayed_removal_is_ignored ( ) -> Result < ( ) > {
4225
4225
let alice = TestContext :: new_alice ( ) . await ;
4226
4226
let bob = TestContext :: new_bob ( ) . await ;
4227
4227
let chat_id = create_group_chat ( & alice, ProtectionStatus :: Unprotected , "Group" ) . await ?;
@@ -4241,38 +4241,33 @@ async fn test_recreate_contact_list_on_missing_messages() -> Result<()> {
4241
4241
let bob_chat_id = bob. recv_msg ( & alice. pop_sent_msg ( ) . await ) . await . chat_id ;
4242
4242
bob_chat_id. accept ( & bob) . await ?;
4243
4243
4244
- // bob removes a member
4244
+ // Bob removes Fiona.
4245
4245
let bob_contact_fiona = Contact :: create ( & bob, "fiona" , "fiona@example.net" ) . await ?;
4246
4246
remove_contact_from_chat ( & bob, bob_chat_id, bob_contact_fiona) . await ?;
4247
4247
let remove_msg = bob. pop_sent_msg ( ) . await ;
4248
4248
4249
- // bob adds new members
4249
+ // Bob adds new members "blue" and "orange", but first addition message is lost.
4250
4250
let bob_blue = Contact :: create ( & bob, "blue" , "blue@example.net" ) . await ?;
4251
4251
add_contact_to_chat ( & bob, bob_chat_id, bob_blue) . await ?;
4252
4252
bob. pop_sent_msg ( ) . await ;
4253
4253
let bob_orange = Contact :: create ( & bob, "orange" , "orange@example.net" ) . await ?;
4254
4254
add_contact_to_chat ( & bob, bob_chat_id, bob_orange) . await ?;
4255
4255
let add_msg = bob. pop_sent_msg ( ) . await ;
4256
4256
4257
- // alice only receives the second member addition
4257
+ // Alice only receives the second member addition,
4258
+ // but this results in addition of both members
4259
+ // and removal of Fiona.
4258
4260
alice. recv_msg ( & add_msg) . await ;
4259
-
4260
- // since we missed messages, a new contact list should be build
4261
4261
assert_eq ! ( get_chat_contacts( & alice, chat_id) . await ?. len( ) , 4 ) ;
4262
4262
4263
- // re-add fiona
4263
+ // Alice re-adds Fiona.
4264
4264
add_contact_to_chat ( & alice, chat_id, alice_fiona) . await ?;
4265
+ assert_eq ! ( get_chat_contacts( & alice, chat_id) . await ?. len( ) , 5 ) ;
4265
4266
4266
- // delayed removal of fiona shouldn't remove her
4267
- alice. recv_msg_trash ( & remove_msg) . await ;
4267
+ // Delayed removal of Fiona by Bob shouldn't remove her.
4268
+ alice. recv_msg ( & remove_msg) . await ;
4268
4269
assert_eq ! ( get_chat_contacts( & alice, chat_id) . await ?. len( ) , 5 ) ;
4269
4270
4270
- alice
4271
- . golden_test_chat (
4272
- chat_id,
4273
- "receive_imf_recreate_contact_list_on_missing_messages" ,
4274
- )
4275
- . await ;
4276
4271
Ok ( ( ) )
4277
4272
}
4278
4273
0 commit comments