@@ -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 delta@merlinux.eu 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 message = bob .wait_for_incoming_msg ()
356356 snapshot = message .get_snapshot ()
@@ -591,94 +591,6 @@ def test_mdn_doesnt_break_autocrypt(acfactory) -> None:
591591 assert snapshot .show_padlock
592592
593593
594- def test_reaction_to_partially_fetched_msg (acfactory , tmp_path ):
595- """See https://github.com/deltachat/deltachat-core-rust/issues/3688 "Partially downloaded
596- messages are received out of order".
597-
598- If the Inbox contains X small messages followed by Y large messages followed by Z small
599- messages, Delta Chat first downloaded a batch of X+Z messages, and then a batch of Y messages.
600-
601- This bug was discovered by @Simon-Laux while testing reactions PR #3644 and can be reproduced
602- with online test as follows:
603- - Bob enables download limit and goes offline.
604- - Alice sends a large message to Bob and reacts to this message with a thumbs-up.
605- - Bob goes online
606- - Bob first processes a reaction message and throws it away because there is no corresponding
607- message, then processes a partially downloaded message.
608- - As a result, Bob does not see a reaction
609- """
610- download_limit = 300000
611- ac1 , ac2 = acfactory .get_online_accounts (2 )
612- ac1_addr = ac1 .get_config ("addr" )
613- chat = ac1 .create_chat (ac2 )
614- ac2 .set_config ("download_limit" , str (download_limit ))
615- ac2 .stop_io ()
616-
617- logging .info ("sending small+large messages from ac1 to ac2" )
618- msgs = []
619- msgs .append (chat .send_text ("hi" ))
620- path = tmp_path / "large"
621- path .write_bytes (os .urandom (download_limit + 1 ))
622- msgs .append (chat .send_file (str (path )))
623- for m in msgs :
624- m .wait_until_delivered ()
625-
626- logging .info ("sending a reaction to the large message from ac1 to ac2" )
627- # TODO: Find the reason of an occasional message reordering on the server (so that the reaction
628- # has a lower UID than the previous message). W/a is to sleep for some time to let the reaction
629- # have a later INTERNALDATE.
630- time .sleep (1.1 )
631- react_str = "\N{THUMBS UP SIGN} "
632- msgs .append (msgs [- 1 ].send_reaction (react_str ))
633- msgs [- 1 ].wait_until_delivered ()
634-
635- ac2 .start_io ()
636-
637- logging .info ("wait for ac2 to receive a reaction" )
638- msg2 = Message (ac2 , ac2 .wait_for_reactions_changed ().msg_id )
639- assert msg2 .get_sender_contact ().get_snapshot ().address == ac1_addr
640- assert msg2 .get_snapshot ().download_state == DownloadState .AVAILABLE
641- reactions = msg2 .get_reactions ()
642- contacts = [Contact (ac2 , int (i )) for i in reactions .reactions_by_contact ]
643- assert len (contacts ) == 1
644- assert contacts [0 ].get_snapshot ().address == ac1_addr
645- assert list (reactions .reactions_by_contact .values ())[0 ] == [react_str ]
646-
647-
648- @pytest .mark .parametrize ("n_accounts" , [3 , 2 ])
649- def test_download_limit_chat_assignment (acfactory , tmp_path , n_accounts ):
650- download_limit = 300000
651-
652- alice , * others = acfactory .get_online_accounts (n_accounts )
653- bob = others [0 ]
654-
655- alice_group = alice .create_group ("test group" )
656- for account in others :
657- chat = account .create_chat (alice )
658- chat .send_text ("Hello Alice!" )
659- assert alice .wait_for_incoming_msg ().get_snapshot ().text == "Hello Alice!"
660-
661- contact = alice .create_contact (account )
662- alice_group .add_contact (contact )
663-
664- bob .set_config ("download_limit" , str (download_limit ))
665-
666- alice_group .send_text ("hi" )
667- snapshot = bob .wait_for_incoming_msg ().get_snapshot ()
668- assert snapshot .text == "hi"
669- bob_group = snapshot .chat
670-
671- path = tmp_path / "large"
672- path .write_bytes (os .urandom (download_limit + 1 ))
673-
674- for i in range (10 ):
675- logging .info ("Sending message %s" , i )
676- alice_group .send_file (str (path ))
677- snapshot = bob .wait_for_incoming_msg ().get_snapshot ()
678- assert snapshot .download_state == DownloadState .AVAILABLE
679- assert snapshot .chat == bob_group
680-
681-
682594def test_markseen_contact_request (acfactory ):
683595 """
684596 Test that seen status is synchronized for contact request messages
0 commit comments