Skip to content

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

Draft
iequidoo wants to merge 1 commit into
mainfrom
iequidoo/send-post-msg-first
Draft

fix: Send pre-message after successful sending of post-message (#8063)#8222
iequidoo wants to merge 1 commit into
mainfrom
iequidoo/send-post-msg-first

Conversation

@iequidoo
Copy link
Copy Markdown
Collaborator

@iequidoo iequidoo commented May 8, 2026

Also, send the message text in the post-message too, we can't support the workaround for duplicated
message text shown in ancient versions anymore, otherwise newer versions won't show the message text
at all.

On the receiving side, download post messages w/o known pre-message after 30s to protect from lost
messages.

This isn't easy to test in Rust 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.

Fix #8063

@iequidoo iequidoo force-pushed the iequidoo/send-post-msg-first branch from a18bf74 to 04832ec Compare May 9, 2026 16:26
Also, send the message text in the post-message too, we can't support the workaround for duplicated
message text shown in ancient versions anymore, otherwise newer versions won't show the message text
at all.

On the receiving side, download post messages w/o known pre-message after 30s to protect from lost
messages.

This isn't easy to test in Rust 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.
@iequidoo iequidoo force-pushed the iequidoo/send-post-msg-first branch from 04832ec to fed3a6a Compare May 11, 2026 08:01
Comment thread src/receive_imf.rs
}

async fn handle_post_message(
async fn update_from_post_msg(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to rename it to underline that only an already existing message is updated, to avoid more bugs caused by not fully handling post-messages

Comment thread src/receive_imf.rs

// Maybe set logging xdc and add gossip topics for webxdcs.
for (part, msg_id) in mime_parser.parts.iter().zip(&created_db_entries) {
if mime_parser.pre_message != PreMessageMode::Post
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compat problem: missing iroh topic id

Comment thread src/download.rs
context: &Context,
session: &mut Session,
) -> Result<()> {
const PRE_MSG_WAIT_TIME: i64 = 30;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compat problem: extra traffic for older versions

Comment thread src/mimefactory.rs
footer
)
};
let message_text = format!(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compat problem: duplicate text for ancient versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not send pre-message if post-message sending failed

1 participant