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.
This commit is contained in:
Michael James Gratton 2017-12-01 13:21:41 +11:00
parent f55cdc33ed
commit 926aae4ef2

View file

@ -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)