fix: do not ignore Message::load_from_db errors

This commit is contained in:
link2xt
2024-04-03 22:44:14 +00:00
committed by bjoern
parent 5cef77b8e6
commit e465415039
2 changed files with 16 additions and 2 deletions

View File

@@ -348,7 +348,9 @@ impl Chat {
// The message reacted to may be deleted physically (`load_from_db()` fails) or marked as a tombstone (`is_trash()`).
// These are no errors as `Param::LastReaction*` are just weak pointers.
// Instead, just return `Ok(None)` and let the caller create another summary.
if let Ok(reaction_msg) = Message::load_from_db(context, reaction_msg_id).await {
if let Some(reaction_msg) =
Message::load_from_db_optional(context, reaction_msg_id).await?
{
if !reaction_msg.chat_id.is_trash() {
let reaction_contact_id = ContactId::new(
self.param