From 5a8de78e497bb3891664331fa4aae1d9d44d8dd0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 24 Sep 2011 00:13:06 +0000 Subject: [PATCH] Monotone-Parent: b76df21b12b927a0f3947b610200a0571cb5d9f1 Monotone-Revision: 46ee9065aaede905dab99601d89e7e2056ff0afd Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-09-24T00:13:06 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ OpenChange/MAPIStoreMailMessage.m | 27 ++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4784cbfd3..85c06a3ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-09-23 Wolfgang Sourdeau + * OpenChange/MAPIStoreMailMessage.m (-getPrChangeKey:inMemCtx) + (-getPrPredecessorChangeList:inMemCtx): when a record is not + returned, invoke the container's synchroniseCache method, as was + done in -objectVersion. + * OpenChange/MAPIStoreMailFolder.m (-synchroniseCache): renamed local var "folderWasModified" to "foundChange", as in MAPIStoreGCSFolder's version. Fixed a bug where "foundChange" diff --git a/OpenChange/MAPIStoreMailMessage.m b/OpenChange/MAPIStoreMailMessage.m index 57cd1af34..3b6dde8ec 100644 --- a/OpenChange/MAPIStoreMailMessage.m +++ b/OpenChange/MAPIStoreMailMessage.m @@ -296,11 +296,19 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data) changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer]; if (!changeKey) { + [self warnWithFormat: @"attempting to get change key" + @" by synchronising folder..."]; + [(MAPIStoreMailFolder *) container synchroniseCache]; [parentFolder synchroniseCache]; changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer]; + if (changeKey) + [self logWithFormat: @"got one"]; + else + { + [self errorWithFormat: @"still nothing. We crash!"]; + abort (); + } } - if (!changeKey) - abort (); *data = [changeKey asBinaryInMemCtx: memCtx]; } @@ -320,7 +328,20 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data) changeList = [(MAPIStoreMailFolder *)[self container] predecessorChangeListForMessageWithKey: [self nameInContainer]]; if (!changeList) - abort (); + { + [self warnWithFormat: @"attempting to get predecessor change list" + @" by synchronising folder..."]; + [(MAPIStoreMailFolder *) container synchroniseCache]; + changeList = [(MAPIStoreMailFolder *)[self container] + predecessorChangeListForMessageWithKey: [self nameInContainer]]; + if (changeList) + [self logWithFormat: @"got one"]; + else + { + [self errorWithFormat: @"still nothing. We crash!"]; + abort (); + } + } *data = [changeList asBinaryInMemCtx: memCtx]; }