fix: Send pre-message after successful sending of post-message (#8063)

This isn't easy to test though because the `smtp` sending code requires an SMTP connection, so it's
only tested (by already existing tests) that messages are queued in the right order.

Another problem is that the `smtp` sending logic doesn't try to send any messages following a
failed-to-send message until the retry limit is reached, so if there's smth wrong with a
post-message, other unrelated messages are delayed, but this problem has already existed.
This commit is contained in:
iequidoo
2026-05-08 00:14:43 -04:00
parent ca70fb9b3a
commit a18bf74620
8 changed files with 66 additions and 41 deletions

View File

@@ -379,7 +379,7 @@ pub(crate) async fn send_msg_to_smtp(
if retries > 6 {
context
.sql
.execute("DELETE FROM smtp WHERE id=?", (rowid,))
.execute("DELETE FROM smtp WHERE msg_id=?", (msg_id,))
.await
.context("Failed to remove message with exceeded retry limit from smtp table")?;
if let Some(mut msg) = Message::load_from_db_optional(context, msg_id).await? {