mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Unlock session before calling add_flag_finalized
add_flag_finalized tries to lock session again and IMAP thread deadlocks if session is not unlocked.
This commit is contained in:
@@ -866,8 +866,14 @@ impl Imap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(ref mut session) = &mut *self.session.lock().await {
|
if let Some(ref mut session) = &mut *self.session.lock().await {
|
||||||
match session.uid_copy(&set, &dest_folder).await {
|
if let Err(err) = session.uid_copy(&set, &dest_folder).await {
|
||||||
Ok(_) => {
|
warn!(context, "Could not copy message: {}", err);
|
||||||
|
return ImapActionResult::Failed;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unreachable!();
|
||||||
|
}
|
||||||
|
|
||||||
if !self.add_flag_finalized(context, uid, "\\Deleted").await {
|
if !self.add_flag_finalized(context, uid, "\\Deleted").await {
|
||||||
warn!(context, "Cannot mark {} as \"Deleted\" after copy.", uid);
|
warn!(context, "Cannot mark {} as \"Deleted\" after copy.", uid);
|
||||||
emit_event!(
|
emit_event!(
|
||||||
@@ -889,15 +895,6 @@ impl Imap {
|
|||||||
);
|
);
|
||||||
ImapActionResult::Success
|
ImapActionResult::Success
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
warn!(context, "Could not copy message: {}", err);
|
|
||||||
ImapActionResult::Failed
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
unreachable!();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user