fix: Send pre-message after successful sending of post-message (#8063)#8222
Draft
iequidoo wants to merge 1 commit into
Draft
fix: Send pre-message after successful sending of post-message (#8063)#8222iequidoo wants to merge 1 commit into
iequidoo wants to merge 1 commit into
Conversation
a18bf74 to
04832ec
Compare
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.
04832ec to
fed3a6a
Compare
iequidoo
commented
May 11, 2026
| } | ||
|
|
||
| async fn handle_post_message( | ||
| async fn update_from_post_msg( |
Collaborator
Author
There was a problem hiding this comment.
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
|
|
||
| // 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 |
Collaborator
Author
There was a problem hiding this comment.
Compat problem: missing iroh topic id
| context: &Context, | ||
| session: &mut Session, | ||
| ) -> Result<()> { | ||
| const PRE_MSG_WAIT_TIME: i64 = 30; |
Collaborator
Author
There was a problem hiding this comment.
Compat problem: extra traffic for older versions
| footer | ||
| ) | ||
| }; | ||
| let message_text = format!( |
Collaborator
Author
There was a problem hiding this comment.
Compat problem: duplicate text for ancient versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
smtpsending 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
smtpsending logic doesn't try to send any messages following afailed-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