mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
Do not try to redownload the message in case of any error
Since switch to async we don't have spurious "database is busy" errors anymore. Since an error is irrecoverable in most cases, we can skip the message. The cost of this is we may accidentally skip a correct message if I/O fails, but the advantage is that we are guaranteed to never confuse irrecoverable error with recoverable one and get stuck in infinite loop redownloading the same message over and over.
This commit is contained in:
@@ -13,7 +13,6 @@ use crate::context::Context;
|
||||
use crate::key::{DcKey, Fingerprint, SignedPublicKey, SignedSecretKey};
|
||||
use crate::keyring::Keyring;
|
||||
use crate::log::LogExt;
|
||||
use crate::mimeparser::{self, ParserErrorExt};
|
||||
use crate::peerstate::Peerstate;
|
||||
use crate::pgp;
|
||||
|
||||
@@ -61,7 +60,7 @@ pub(crate) async fn prepare_decryption(
|
||||
mail: &ParsedMail<'_>,
|
||||
from: &str,
|
||||
message_time: i64,
|
||||
) -> mimeparser::ParserResult<DecryptionInfo> {
|
||||
) -> Result<DecryptionInfo> {
|
||||
let autocrypt_header = Aheader::from_headers(from, &mail.headers)
|
||||
.ok_or_log_msg(context, "Failed to parse Autocrypt header")
|
||||
.flatten();
|
||||
@@ -76,8 +75,7 @@ pub(crate) async fn prepare_decryption(
|
||||
// Disallowing keychanges is disabled for now:
|
||||
true, // dkim_results.allow_keychange,
|
||||
)
|
||||
.await
|
||||
.map_err_sql()?;
|
||||
.await?;
|
||||
|
||||
Ok(DecryptionInfo {
|
||||
from: from.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user