mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
fix: upload sync messages only with the primary transport
Currently there is a race between transports to upload sync messages and delete them from `imap_send` table. Sometimes mulitple transports upload the same message and sometimes only some of them "win". With this change only the primary transport will upload the sync message.
This commit is contained in:
@@ -578,12 +578,19 @@ async fn fetch_idle(
|
||||
mvbox.as_deref().unwrap_or(&watch_folder)
|
||||
}
|
||||
};
|
||||
session
|
||||
.send_sync_msgs(ctx, syncbox)
|
||||
.await
|
||||
.context("fetch_idle: send_sync_msgs")
|
||||
.log_err(ctx)
|
||||
.ok();
|
||||
if ctx
|
||||
.get_config(Config::ConfiguredAddr)
|
||||
.await?
|
||||
.unwrap_or_default()
|
||||
== connection.addr
|
||||
{
|
||||
session
|
||||
.send_sync_msgs(ctx, syncbox)
|
||||
.await
|
||||
.context("fetch_idle: send_sync_msgs")
|
||||
.log_err(ctx)
|
||||
.ok();
|
||||
}
|
||||
|
||||
session
|
||||
.store_seen_flags_on_imap(ctx)
|
||||
|
||||
Reference in New Issue
Block a user