[geary] Correct message count when saving/removing draft: Closes bgo#724910



commit c16369a81a6622ad4a9ec69654abdf9f3db5f674
Author: Jim Nelson <jim yorba org>
Date:   Mon Feb 24 15:43:57 2014 -0800

    Correct message count when saving/removing draft: Closes bgo#724910
    
    ReplayRemoval must be processed in-order with ReplayAppend operations.
    By making it local-only, removals could execute before previous append
    notifications.

 .../replay-ops/imap-engine-replay-removal.vala     |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala
index 4195168..eeea5e2 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-replay-removal.vala
@@ -10,7 +10,7 @@ private class Geary.ImapEngine.ReplayRemoval : Geary.ImapEngine.ReplayOperation
     public Imap.SequenceNumber position;
     
     public ReplayRemoval(MinimalFolder owner, int remote_count, Imap.SequenceNumber position) {
-        base ("Removal", Scope.LOCAL_ONLY);
+        base ("Removal", Scope.LOCAL_AND_REMOTE);
         
         this.owner = owner;
         this.remote_count = remote_count;
@@ -31,16 +31,17 @@ private class Geary.ImapEngine.ReplayRemoval : Geary.ImapEngine.ReplayOperation
     }
     
     public override async ReplayOperation.Status replay_local_async() throws Error {
-        yield owner.do_replay_removed_message(remote_count, position);
-        
-        return ReplayOperation.Status.COMPLETED;
+        // Although technically a local-only operation, must treat as remote to ensure it's
+        // processed in-order with ReplayAppend operations
+        return ReplayOperation.Status.CONTINUE;
     }
     
     public override async void backout_local_async() throws Error {
     }
     
     public override async ReplayOperation.Status replay_remote_async() throws Error {
-        // should not be called
+        yield owner.do_replay_removed_message(remote_count, position);
+        
         return ReplayOperation.Status.COMPLETED;
     }
     


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