fix: do not fail to receive post-message with status updates for deleted webxdc

receive_imf should not fail in this case,
but trash the post-message and updates.

The problem with previously used message::rfc724_mid_exists check
was that rfc724_mid_exists may return a trashed message.
This commit is contained in:
link2xt
2026-05-23 21:57:58 +00:00
committed by l
parent 98123afb62
commit 24848c0265
3 changed files with 70 additions and 11 deletions
+6 -11
View File
@@ -835,21 +835,16 @@ UPDATE config SET value=? WHERE keyname='configured_addr' AND value!=?1
{
can_info_msg = false;
if mime_parser.pre_message == PreMessageMode::Post
&& let Some(msg_id) = message::rfc724_mid_exists(context, rfc724_mid_orig).await?
&& let Some(msg) =
Message::load_by_rfc724_mid_optional(context, rfc724_mid_orig).await?
{
// The messsage is a post-message and pre-message exists.
// Assign status update to existing message because just received post-message will be trashed.
Some(
Message::load_from_db(context, msg_id)
.await
.context("Failed to load webxdc instance that we just checked exists")?,
)
Some(msg)
} else {
Some(
Message::load_from_db(context, insert_msg_id)
.await
.context("Failed to load just created webxdc instance")?,
)
Message::load_from_db_optional(context, insert_msg_id)
.await
.context("Failed to load just created webxdc instance")?
}
} else if let Some(field) = mime_parser.get_header(HeaderDef::InReplyTo) {
if let Some(instance) =