From e7d88fa2cdf04777ddbd50d400945ebee3d9b66a Mon Sep 17 00:00:00 2001 From: iequidoo Date: Tue, 23 Jan 2024 15:30:24 -0300 Subject: [PATCH] test: try to reproduce (#5201) --- python/tests/test_0_complex_or_slow.py | 9 ++++++- src/ephemeral.rs | 35 ++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/python/tests/test_0_complex_or_slow.py b/python/tests/test_0_complex_or_slow.py index 11f8dd6c36..cc9434ad98 100644 --- a/python/tests/test_0_complex_or_slow.py +++ b/python/tests/test_0_complex_or_slow.py @@ -627,7 +627,14 @@ def test_verified_group_vs_delete_server_after(acfactory, tmp_path, lp): chat2 = ac2.qr_join_chat(qr) ac1._evtracker.wait_securejoin_inviter_progress(1000) # Wait for "Member Me () added by ." message. - msg_in = ac2._evtracker.wait_next_incoming_message() + try: + ev = ac2._evtracker.get_matching("DC_EVENT_INCOMING_MSG", timeout=60) + msg_in = ac2.get_message_by_id(ev.data2) + except Exception: + ac2.stop_io() + ac2.start_io() + msg_in = ac2._evtracker.wait_next_incoming_message() + assert False assert msg_in.is_system_message() lp.sec("ac2: waiting for 'member added' to be deleted on the server") diff --git a/src/ephemeral.rs b/src/ephemeral.rs index 694c1d41c7..3bedfd96c9 100644 --- a/src/ephemeral.rs +++ b/src/ephemeral.rs @@ -596,7 +596,7 @@ pub(crate) async fn delete_expired_imap_messages(context: &Context) -> Result<() }; let target = context.get_delete_msgs_target().await?; - context + let msg_cnt = context .sql .execute( "UPDATE imap @@ -615,7 +615,38 @@ pub(crate) async fn delete_expired_imap_messages(context: &Context) -> Result<() ), ) .await?; - + info!( + context, + "delete_expired_imap_messages: {threshold_timestamp}: Marked {msg_cnt} messages.", + ); + let Some(rfc724_mid) = context + .sql + .query_get_value::( + "SELECT rfc724_mid from imap WHERE folder='INBOX' AND uid=14", + (), + ) + .await? + else { + return Ok(()); + }; + info!( + context, + "delete_expired_imap_messages: rfc724_mid={rfc724_mid}", + ); + let Some(timestamp) = context + .sql + .query_get_value::( + "SELECT timestamp from msgs WHERE rfc724_mid=?", + (rfc724_mid,), + ) + .await? + else { + return Ok(()); + }; + info!( + context, + "delete_expired_imap_messages: timestamp={timestamp}", + ); Ok(()) }