summaryrefslogtreecommitdiff
path: root/src/leap/mail/mail.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-03-02 15:00:12 -0400
committerKali Kaneko <kali@leap.se>2015-03-03 14:30:18 -0400
commitbd5f777ff5e9f4fd81afeebb17074326b2671cd1 (patch)
treead52a26e4431c4e7858f17cfc20f0243f64a2fa2 /src/leap/mail/mail.py
parent0f491cc4f94c00cd9c6e2afe7e3163dfaaad3714 (diff)
[bug] Fix testExpunge tests
this test was failing randomly because we were returning the deferred before all the documents were saved into soledad store. changed also the delete_msg deferred chaining for better readability. Releases: 0.9.0
Diffstat (limited to 'src/leap/mail/mail.py')
-rw-r--r--src/leap/mail/mail.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/leap/mail/mail.py b/src/leap/mail/mail.py
index 584cc4a..ef9a0d9 100644
--- a/src/leap/mail/mail.py
+++ b/src/leap/mail/mail.py
@@ -645,8 +645,13 @@ class MessageCollection(object):
for h in hashes:
d.append(self.mbox_indexer.delete_doc_by_hash(
self.mbox_uuid, h))
- return defer.gatherResults(d).addCallback(
- lambda _: uids)
+
+ def return_uids_when_deleted(ignored):
+ return uids
+
+ all_deleted = defer.gatherResults(d).addCallback(
+ return_uids_when_deleted)
+ return all_deleted
mdocs_deleted = self.adaptor.del_all_flagged_messages(
self.store, self.mbox_uuid)