diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 00756a77f..71c8322d3 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -1438,8 +1438,6 @@ class TestGroupStressTests: lp.sec("ac2: check that ac3 is removed") msg = ac2.wait_next_incoming_message() - # ac2 did not see that ac3 was removed - # FIXME: due to a bug, ac2 thinks ac3 is still in the chat assert len(msg.chat.get_contacts()) == len(chat.get_contacts()) diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index d65107540..16ddba483 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -1023,6 +1023,17 @@ fn create_or_lookup_group( // add members to group/check members if recreate_member_list { if !chat::is_contact_in_chat(context, chat_id, DC_CONTACT_ID_SELF) { + // Members could have been removed while we were + // absent. We can't use existing member list and need to + // start from scratch. + sql::execute( + context, + &context.sql, + "DELETE FROM chats_contacts WHERE chat_id=?;", + params![chat_id], + ) + .ok(); + chat::add_to_chat_contacts_table(context, chat_id, DC_CONTACT_ID_SELF); } if from_id > DC_CONTACT_ID_LAST_SPECIAL