fix: delete available_post_msgs row if the message is already downloaded

The row does not need to stay in the database
only to be skipped each time.
This commit is contained in:
link2xt
2026-03-22 22:32:34 +01:00
parent aedc60f1cc
commit f2e5d13bb9

View File

@@ -326,7 +326,11 @@ pub(crate) async fn download_known_post_messages_without_pre_message(
}) })
.await?; .await?;
for rfc724_mid in &rfc724_mids { for rfc724_mid in &rfc724_mids {
if !msg_is_downloaded_for(context, rfc724_mid).await? { if msg_is_downloaded_for(context, rfc724_mid).await? {
delete_from_available_post_msgs(context, rfc724_mid).await?;
continue;
}
// Download the Post-Message unconditionally, // Download the Post-Message unconditionally,
// because the Pre-Message got lost. // because the Pre-Message got lost.
// The message may be in the wrong order, // The message may be in the wrong order,
@@ -343,7 +347,6 @@ pub(crate) async fn download_known_post_messages_without_pre_message(
); );
} }
} }
}
Ok(()) Ok(())
} }