@@ -336,7 +336,7 @@ def test_receive_imf_failure(acfactory) -> None:
336336 alice_contact_bob = alice .create_contact (bob , "Bob" )
337337 alice_chat_bob = alice_contact_bob .create_chat ()
338338
339- bob .set_config ("fail_on_receiving_full_msg " , "1" )
339+ bob .set_config ("simulate_receive_imf_error " , "1" )
340340 alice_chat_bob .send_text ("Hello!" )
341341 event = bob .wait_for_event (EventType .MSGS_CHANGED )
342342 assert event .chat_id == bob .get_device_chat ().id
@@ -345,12 +345,12 @@ def test_receive_imf_failure(acfactory) -> None:
345345 snapshot = message .get_snapshot ()
346346 assert (
347347 snapshot .text == "❌ Failed to receive a message:"
348- " Condition failed: `!context.get_config_bool(Config::FailOnReceivingFullMsg ).await?`."
348+ " Condition failed: `!context.get_config_bool(Config::SimulateReceiveImfError ).await?`."
349349 " Please report this bug to [email protected] or https://support.delta.chat/." 350350 )
351351
352352 # The failed message doesn't break the IMAP loop.
353- bob .set_config ("fail_on_receiving_full_msg " , "0" )
353+ bob .set_config ("simulate_receive_imf_error " , "0" )
354354 alice_chat_bob .send_text ("Hello again!" )
355355 event = bob .wait_for_incoming_msg_event ()
356356 msg_id = event .msg_id
@@ -604,60 +604,6 @@ def test_mdn_doesnt_break_autocrypt(acfactory) -> None:
604604 assert snapshot .show_padlock
605605
606606
607- def test_reaction_to_partially_fetched_msg (acfactory , tmp_path ):
608- """See https://github.com/deltachat/deltachat-core-rust/issues/3688 "Partially downloaded
609- messages are received out of order".
610-
611- If the Inbox contains X small messages followed by Y large messages followed by Z small
612- messages, Delta Chat first downloaded a batch of X+Z messages, and then a batch of Y messages.
613-
614- This bug was discovered by @Simon-Laux while testing reactions PR #3644 and can be reproduced
615- with online test as follows:
616- - Bob enables download limit and goes offline.
617- - Alice sends a large message to Bob and reacts to this message with a thumbs-up.
618- - Bob goes online
619- - Bob first processes a reaction message and throws it away because there is no corresponding
620- message, then processes a partially downloaded message.
621- - As a result, Bob does not see a reaction
622- """
623- download_limit = 300000
624- ac1 , ac2 = acfactory .get_online_accounts (2 )
625- ac1_addr = ac1 .get_config ("addr" )
626- chat = ac1 .create_chat (ac2 )
627- ac2 .set_config ("download_limit" , str (download_limit ))
628- ac2 .stop_io ()
629-
630- logging .info ("sending small+large messages from ac1 to ac2" )
631- msgs = []
632- msgs .append (chat .send_text ("hi" ))
633- path = tmp_path / "large"
634- path .write_bytes (os .urandom (download_limit + 1 ))
635- msgs .append (chat .send_file (str (path )))
636- for m in msgs :
637- m .wait_until_delivered ()
638-
639- logging .info ("sending a reaction to the large message from ac1 to ac2" )
640- # TODO: Find the reason of an occasional message reordering on the server (so that the reaction
641- # has a lower UID than the previous message). W/a is to sleep for some time to let the reaction
642- # have a later INTERNALDATE.
643- time .sleep (1.1 )
644- react_str = "\N{THUMBS UP SIGN} "
645- msgs .append (msgs [- 1 ].send_reaction (react_str ))
646- msgs [- 1 ].wait_until_delivered ()
647-
648- ac2 .start_io ()
649-
650- logging .info ("wait for ac2 to receive a reaction" )
651- msg2 = Message (ac2 , ac2 .wait_for_reactions_changed ().msg_id )
652- assert msg2 .get_sender_contact ().get_snapshot ().address == ac1_addr
653- assert msg2 .get_snapshot ().download_state == DownloadState .AVAILABLE
654- reactions = msg2 .get_reactions ()
655- contacts = [Contact (ac2 , int (i )) for i in reactions .reactions_by_contact ]
656- assert len (contacts ) == 1
657- assert contacts [0 ].get_snapshot ().address == ac1_addr
658- assert list (reactions .reactions_by_contact .values ())[0 ] == [react_str ]
659-
660-
661607def test_reactions_for_a_reordering_move (acfactory , direct_imap ):
662608 """When a batch of messages is moved from Inbox to DeltaChat folder with a single MOVE command,
663609 their UIDs may be reordered (e.g. Gmail is known for that) which led to that messages were
@@ -702,50 +648,6 @@ def test_reactions_for_a_reordering_move(acfactory, direct_imap):
702648 assert list (reactions .reactions_by_contact .values ())[0 ] == [react_str ]
703649
704650
705- @pytest .mark .parametrize ("n_accounts" , [3 , 2 ])
706- def test_download_limit_chat_assignment (acfactory , tmp_path , n_accounts ):
707- download_limit = 300000
708-
709- alice , * others = acfactory .get_online_accounts (n_accounts )
710- bob = others [0 ]
711-
712- alice_group = alice .create_group ("test group" )
713- for account in others :
714- chat = account .create_chat (alice )
715- chat .send_text ("Hello Alice!" )
716- assert alice .get_message_by_id (alice .wait_for_incoming_msg_event ().msg_id ).get_snapshot ().text == "Hello Alice!"
717-
718- contact = alice .create_contact (account )
719- alice_group .add_contact (contact )
720-
721- if n_accounts == 2 :
722- bob_chat_alice = bob .create_chat (alice )
723- bob .set_config ("download_limit" , str (download_limit ))
724-
725- alice_group .send_text ("hi" )
726- snapshot = bob .get_message_by_id (bob .wait_for_incoming_msg_event ().msg_id ).get_snapshot ()
727- assert snapshot .text == "hi"
728- bob_group = snapshot .chat
729-
730- path = tmp_path / "large"
731- path .write_bytes (os .urandom (download_limit + 1 ))
732-
733- for i in range (10 ):
734- logging .info ("Sending message %s" , i )
735- alice_group .send_file (str (path ))
736- snapshot = bob .get_message_by_id (bob .wait_for_incoming_msg_event ().msg_id ).get_snapshot ()
737- assert snapshot .download_state == DownloadState .AVAILABLE
738- if n_accounts > 2 :
739- assert snapshot .chat == bob_group
740- else :
741- # Group contains only Alice and Bob,
742- # so partially downloaded messages are
743- # hard to distinguish from private replies to group messages.
744- #
745- # Message may be a private reply, so we assign it to 1:1 chat with Alice.
746- assert snapshot .chat == bob_chat_alice
747-
748-
749651def test_markseen_contact_request (acfactory ):
750652 """
751653 Test that seen status is synchronized for contact request messages
0 commit comments