Homekolab.org

Avoid using realMessageCount as it will start continuously resyncing the full…

Authored by Christian Mollekopf <chrigi_1@fastmail.fm> on Jul 28 2016, 6:29 PM.

Description

Avoid using realMessageCount as it will start continuously resyncing the full message box on any error at all.

After optimizing the item removal algorithm it performs sufficiently
for a 40k folder (~3s), that we can run it every time.
We now get a full listing on every sync, but using a search
command which is fast (because it only returns uid's).

We could optimize the case where nothing changed, but that would rely
on the itemCount again, so if that is off we wouldn't hit the
optimization anyways.

The next best proper optimization would be relying on QRESYNC to fetch
removed messages instead of the SEARCH command.