Skip to content

Conversation

nicodh
Copy link
Contributor

@nicodh nicodh commented Sep 1, 2025

resolves #6849

I tested this fix with desktop as described in deltachat/deltachat-desktop#5414 and the behaviour is now as expected imo: showing a message with status failed

Copy link
Collaborator

@iequidoo iequidoo left a comment

Choose a reason for hiding this comment

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

A test is needed also, but may be added later

Ok(mf) => mf,
Err(err) => {
// Mark message as failed
message::set_msg_failed(context, msg, &err.to_string())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good, but if the app crashes before this call or for some other reason doesn't reach even the MimeFactory::from_msg() call, the message will remain OutPending. We need some additional recovery code path pushing such messages through create_send_msg_jobs() again, maybe somewhere in the SMTP loop.

Copy link
Collaborator

@Hocuri Hocuri Sep 2, 2025

Choose a reason for hiding this comment

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

This PR already works in 99.9% of cases, which is good enough here - it's super unlikely that a) an outgoing message fails AND b) the app will by chance be killed at this exact moment. And if some outgoing message makes core crash (i.e. panic-abort), it's actually better not to process it again.

@farooqkz
Copy link

farooqkz commented Sep 2, 2025

Thanks Nico for taking care of this. And sorry for replying late.

@nicodh nicodh merged commit 143ba6d into main Sep 2, 2025
29 checks passed
@nicodh nicodh deleted the mark-message-as-failed branch September 2, 2025 12:32
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.

Message is in "pending" state even if no recipient key is available
4 participants