engine: Cancel any remote folders update before marking a message

When marking a message, a race condition can happen:
- A remote folders update is already running
- We mark the message locally and replay it remotely
- The previous remote update result restores invalid values locally
This commit is contained in:
Cédric Bellegarde 2022-09-22 11:49:05 +02:00
parent f45afac091
commit 1a7a3a987a
5 changed files with 43 additions and 0 deletions

View file

@ -58,6 +58,13 @@ public class Mock.Account : Geary.Account,
}
}
public override void cancel_remote_update() {
try {
void_call("cancel_remote_update", {});
} catch (GLib.Error err) {
}
}
public override async void rebuild_async(GLib.Cancellable? cancellable = null)
throws GLib.Error {
void_call("rebuild_async", { cancellable });