Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: try to reproduce (#5201) #5209

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion python/tests/test_0_complex_or_slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<addr>) added by <addr>." 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")
Expand Down
35 changes: 33 additions & 2 deletions src/ephemeral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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::<String>(
"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::<i64>(
"SELECT timestamp from msgs WHERE rfc724_mid=?",
(rfc724_mid,),
)
.await?
else {
return Ok(());
};
info!(
context,
"delete_expired_imap_messages: timestamp={timestamp}",
);
Ok(())
}

Expand Down
Loading