@@ -338,44 +338,27 @@ def test_receive_imf_failure(acfactory) -> None:
338338
339339 bob .set_config ("fail_on_receiving_full_msg" , "1" )
340340 alice_chat_bob .send_text ("Hello!" )
341- event = bob .wait_for_incoming_msg_event ( )
342- chat_id = event . chat_id
341+ event = bob .wait_for_event ( EventType . MSGS_CHANGED )
342+ assert event . chat_id == bob . get_device_chat (). id
343343 msg_id = event .msg_id
344344 message = bob .get_message_by_id (msg_id )
345345 snapshot = message .get_snapshot ()
346- assert snapshot . chat_id == chat_id
347- assert snapshot .download_state == DownloadState . AVAILABLE
348- assert snapshot . error is not None
349- assert snapshot . show_padlock
350- snapshot . chat . accept ( )
346+ assert (
347+ snapshot .text == "❌ Failed to receive a message:"
348+ " Condition failed: `!context.get_config_bool(Config::FailOnReceivingFullMsg).await?`."
349+ " Please report this bug to delta@merlinux.eu or https://support.delta.chat/."
350+ )
351351
352352 # The failed message doesn't break the IMAP loop.
353353 bob .set_config ("fail_on_receiving_full_msg" , "0" )
354354 alice_chat_bob .send_text ("Hello again!" )
355355 event = bob .wait_for_incoming_msg_event ()
356- assert event .chat_id == chat_id
357- msg_id = event .msg_id
358- message1 = bob .get_message_by_id (msg_id )
359- snapshot = message1 .get_snapshot ()
360- assert snapshot .chat_id == chat_id
361- assert snapshot .download_state == DownloadState .DONE
362- assert snapshot .error is None
363-
364- # The failed message can be re-downloaded later.
365- bob ._rpc .download_full_message (bob .id , message .id )
366- event = bob .wait_for_event (EventType .MSGS_CHANGED )
367- message = bob .get_message_by_id (event .msg_id )
368- snapshot = message .get_snapshot ()
369- assert snapshot .download_state == DownloadState .IN_PROGRESS
370- event = bob .wait_for_event (EventType .MSGS_CHANGED )
371- assert event .chat_id == chat_id
372356 msg_id = event .msg_id
373357 message = bob .get_message_by_id (msg_id )
374358 snapshot = message .get_snapshot ()
375- assert snapshot .chat_id == chat_id
359+ assert snapshot .text == "Hello again!"
376360 assert snapshot .download_state == DownloadState .DONE
377361 assert snapshot .error is None
378- assert snapshot .text == "Hello!"
379362
380363
381364def test_selfavatar_sync (acfactory , data , log ) -> None :
0 commit comments