[geary/wip/713530-background-sync: 5/6] Enforce a an API contract clause for Geary.Folder.list_email_by_id_async.



commit 8f90cf19cba5c8ed1b1e601a006a6b02ba11cd5d
Author: Michael James Gratton <mike vee net>
Date:   Fri Dec 1 13:21:41 2017 +1100

    Enforce a an API contract clause for Geary.Folder.list_email_by_id_async.
    
    * src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala
      (AbstractListEmail): Throw an error if asking for a specific message,
      asking for it to be included in the results, but the message not
      actually appearing in the results.

 .../replay-ops/imap-engine-list-email-by-id.vala   |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala
index ab3f0e2..703e0cc 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-list-email-by-id.vala
@@ -57,7 +57,14 @@ private class Geary.ImapEngine.ListEmailByID : Geary.ImapEngine.AbstractListEmai
                     add_unfulfilled_fields(uid, required_fields.clear(email.fields));
             }
         }
-        
+
+        if (this.flags.is_including_id() && this.initial_uid == null) {
+            throw new EngineError.NOT_FOUND(
+                "Initial id not found in local set: %s",
+                this.initial_id.to_string()
+            );
+        }
+
         // report fulfilled items
         fulfilled_count = fulfilled.size;
         if (fulfilled_count > 0)


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