[Kde-pim] [Akonadi] [Bug 319450] Re: Mailbox synchronization can miss important mailbox state updates -- broken EXISTS and UIDNEXT heuristic

Volker Krause vkrause at kde.org
Sat May 18 12:26:24 BST 2013


On Friday 17 May 2013 12:15:18 Jan Kundrát wrote:
> On Thursday, 16 May 2013 21:37:13 CEST, Volker Krause wrote:
> > The code cited above is only the part handling downloading of new
> > messages,
> > detection of deletions, flag changes, etc happens elsewhere in that class
> > as well as to a large part in Akonadi::ItemSync.
> 
> Hi Volker, sorry for using Bugzilla for a wrong purpose -- in retrospect, I
> see that asking on the ML might have been better.
> 
> Could you please point me to the code which performs the actual "mailbox
> synchronization" (i.e. what happens during the SELECT processing)? Where is
> the code which decides what to do next? Is there a place where this is
> described in the docs?

I don't think there is higher level documentation for the syncing algorithm of 
the IMAP resource.

> I grepped for "uidnext" (and found that it's also called "nextuid"
> throughout the code, so I widened my search). I used both of these terms in
> a case-insensitive manner and looked under kdepimlibs and kdepim-runtime.
> The only place which looks relevant to my eyes (familiar with IMAP, C++ and
> Qt, but completely alien to Akonadi) is
> RetrieveItemsTask::onFinalSelectDone within the
> kdepim-runtime:resources/imap/retrieveitemstask.cpp. I assume that this is
> the place which controls what to do right after a SELECT is processed and
> that there is no other place which could control the sync. Are these
> assumptions right?

Yes, RetrieveItemsTask is the class handling mailbox syncing, ie. downloading 
headers (or full bodys, depending on cache policy) of new messages, deleting 
stuff that was removed on the server locally, and updating flags.

It has two modes, full syncing is "correct" but requires a full listing of ids 
and flags to detect all changes (ie. linear scaling with amount of mails in 
mailbox), fast syncing does not detect all kinds of remote changes but only 
new messages (linear scaling with amount of new mails), which might be enough 
in some scenarios. Full syncing is the default.

Note that the comparison to the local state is hidden behind the 
retrieveItemsX calls and internally covered by Akonadi::ItemSync.

> Is there a unit test which checks how this synchronization works?

Unit tests are in kdepim-runtime/resources/imap/tests, but not sure if they 
cover the problem you are looking for.

regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20130518/b9441b4b/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list