feat: Execute sync message before checking for primary transport update

This way, if the sync message updates transports, the check for a new primary transport is done
against the updated transport list which is more reliable.
This commit is contained in:
iequidoo
2026-01-10 21:40:53 -03:00
committed by iequidoo
parent e456be4e21
commit ed300b6f97

View File

@@ -811,6 +811,10 @@ pub(crate) async fn receive_imf_inner(
if let Some(ref sync_items) = mime_parser.sync_items {
if from_id == ContactId::SELF {
if mime_parser.was_encrypted() {
context
.execute_sync_items(sync_items, mime_parser.timestamp_sent)
.await;
// Receiving encrypted message from self updates primary transport.
let from_addr = &mime_parser.from.addr;
@@ -845,10 +849,6 @@ pub(crate) async fn receive_imf_inner(
info!(context, "Primary transport changed to {from_addr:?}.");
context.sql.uncache_raw_config("configured_addr").await;
}
context
.execute_sync_items(sync_items, mime_parser.timestamp_sent)
.await;
} else {
warn!(context, "Sync items are not encrypted.");
}