Reduce noise about sync failures
commit4ca416405358777c240f2d553ba49f582df4560a
authorJan Kundrát <jkt@kde.org>
Tue, 8 Mar 2016 10:45:21 +0000 (8 11:45 +0100)
committerJan Kundrát <jkt@kde.org>
Tue, 8 Mar 2016 10:45:21 +0000 (8 11:45 +0100)
treee49974014371ad4cdf2354ef27f57a60d2a412cd
parent6a65385a96221a285c9fe9e52d70bf5541071c36
Reduce noise about sync failures

We were a little bit split-brained about the mechanism in which we send
out signals about a failing mailbox synchronization. On one hand, the
idea was to not overwhelm the user with a stream of notifications, on
the other hand it was also interesting to have a program access to
failures related to mailbox syncing simply because there are contexts
where it is needed.

This patch tries to find a middle ground. The notifications will still
be raised when an actual synchronization takes place (that is, while the
code is figuring out what happened since the last sync). However, when
the mailbox has been already synced and we are "only" maintaining an
up-to-date connection, there won't be any notifications anymore.

Note that the "synchronization" I'm talking about is not necessarily the
initial sync of a mailbox, but rather that sort of sync which happens
each time a mailbox is opened. I suppose that there's a certain
correlation in terms of occurrences of network failures and a sync
activity going on (think flappy network), but let's give this a shot.

Change-Id: Id9c6a73e4e171b996881659f9e51e423f68f3b99
src/Imap/Tasks/KeepMailboxOpenTask.cpp
src/Imap/Tasks/KeepMailboxOpenTask.h