[geary/wip/794700-lazy-load-conversations: 16/19] Fix FetchEmail remote op error when FORCE_UPDATE is set



commit bb1ccb09b2ab85774d27336043db485237dfcc6b
Author: Michael Gratton <mike vee net>
Date:   Mon Jan 21 10:25:55 2019 +1030

    Fix FetchEmail remote op error when FORCE_UPDATE is set
    
    Need to load the UID locally even when FORCE_UPDATE is set otherwise it
    will be null when the remote op is executed.

 .../imap-engine/replay-ops/imap-engine-fetch-email.vala     | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
index 22ae0949..5a5039bc 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
@@ -40,10 +40,15 @@ private class Geary.ImapEngine.FetchEmail : Geary.ImapEngine.SendReplayOperation
     }
 
     public override async ReplayOperation.Status replay_local_async() throws Error {
-        // If forcing an update, skip local operation and go direct to replay_remote()
-        if (flags.is_all_set(Folder.ListFlags.FORCE_UPDATE))
-            return ReplayOperation.Status.CONTINUE;
-        
+        if (flags.is_all_set(Folder.ListFlags.FORCE_UPDATE)) {
+            // Forcing an update, get the local UID then go direct to
+            // replay_remote()
+            this.uid = yield engine.local_folder.get_uid_async(
+                this.id, NONE, this.cancellable
+            );
+            return CONTINUE;
+        }
+
         try {
             email = yield engine.local_folder.fetch_email_async(id, required_fields,
                 ImapDB.Folder.ListFlags.PARTIAL_OK, cancellable);


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