@@ -1587,6 +1587,39 @@ def test_qr_join_chat(acfactory, lp):
1587
1587
ac1 ._evtracker .wait_securejoin_inviter_progress (1000 )
1588
1588
1589
1589
1590
+ def test_qr_email_capitalization (acfactory , lp ):
1591
+ """Regression test for a bug
1592
+ that resulted in failure to propagate verification via gossip in a verified group
1593
+ when the database already contained the contact with a different email address capitalization.
1594
+ """
1595
+
1596
+ ac1 , ac2 , ac3 = acfactory .get_online_accounts (3 )
1597
+
1598
+ # ac1 adds ac2 as a contact with an email address in uppercase.
1599
+ ac2_addr_uppercase = ac2 .get_config ("addr" ).upper ()
1600
+ lp .sec (f"ac1 creates a contact for ac2 ({ ac2_addr_uppercase } )" )
1601
+ ac1 .create_contact (ac2_addr_uppercase )
1602
+
1603
+ lp .sec ("ac3 creates a verified group with a QR code" )
1604
+ chat = ac3 .create_group_chat ("hello" , verified = True )
1605
+ qr = chat .get_join_qr ()
1606
+
1607
+ lp .sec ("ac1 joins a verified group via a QR code" )
1608
+ ac1_chat = ac1 .qr_join_chat (qr )
1609
+ msg = ac1 ._evtracker .wait_next_incoming_message ()
1610
+ assert msg .text == "Member Me ({}) added by {}." .format (ac1 .get_config ("addr" ), ac3 .get_config ("addr" ))
1611
+ assert len (ac1_chat .get_contacts ()) == 2
1612
+
1613
+ lp .sec ("ac2 joins a verified group via a QR code" )
1614
+ ac2 .qr_join_chat (qr )
1615
+ ac1 ._evtracker .wait_next_incoming_message ()
1616
+
1617
+ # ac1 should see both ac3 and ac2 as verified.
1618
+ assert len (ac1_chat .get_contacts ()) == 3
1619
+ for contact in ac1_chat .get_contacts ():
1620
+ assert contact .is_verified ()
1621
+
1622
+
1590
1623
def test_set_get_contact_avatar (acfactory , data , lp ):
1591
1624
lp .sec ("configuring ac1 and ac2" )
1592
1625
ac1 , ac2 = acfactory .get_online_accounts (2 )
0 commit comments