IMAP resource: fix data loss on connection lost, depending on the current task

Authored by dfaure on Apr 21 2018, 10:37 PM.

Description

IMAP resource: fix data loss on connection lost, depending on the current task

Summary:
If the current task is e.g. uploading an item to the server, we don't
want to cancelTask (which means give up and never try again), we want to
deferTask, so we try again later. Otherwise, well, this is how we end up
with items without a remote id, which makes syncing that folder much
slower every time due to the item count mismatch.

Abstracted with a new method abortTask, which calls cancel or defer
depending on the type of task.

Test Plan:
Sync large folder in kmail, abort sync. But I didn't test any of
the task types other than collection sync...

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: KDE PIM

Tags: KDE PIM

Differential Revision: https://phabricator.kde.org/D12427

Merged Changes

CommitAuthorDetailsCommitted
60dbde3cd4e5D12427dfaure
IMAP resource: fix data loss on connection lost, depending on the current task 
Apr 22 2018