[geary/wip/empty-folder-errors: 2/2] Fix error emptying trash/junk folders



commit ca7873274d3098a897481223f256fe1e6844d837
Author: Michael Gratton <mike vee net>
Date:   Sun Aug 11 21:40:29 2019 +1000

    Fix error emptying trash/junk folders
    
    Add a ReplayQueue checkpoint after queing the empty op to keep the
    folder open long enought that all flag updates and expunge notifies are
    received and processed.

 src/engine/imap-engine/imap-engine-minimal-folder.vala | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala 
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index b450f4ec..7a0b6c54 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -1230,10 +1230,14 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
     protected async void expunge_all_async(Cancellable? cancellable = null) throws Error {
         check_open("expunge_all_async");
 
-        EmptyFolder empty_folder = new EmptyFolder(this, cancellable);
-        replay_queue.schedule(empty_folder);
+        EmptyFolder op = new EmptyFolder(this, cancellable);
+        this.replay_queue.schedule(op);
+        yield op.wait_for_ready_async(cancellable);
 
-        yield empty_folder.wait_for_ready_async(cancellable);
+        // Checkpoint the replay queue, so it and the folder remains
+        // open while processing first the flag updates then the
+        // expunge from the remote
+        yield this.replay_queue.checkpoint(cancellable);
     }
 
     private void check_open(string method) throws EngineError {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]