Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Early-out finalize() for Google Contacts …
Browse files Browse the repository at this point in the history
…in error case. Contributes to JB#38210

Previously, a bug in the finalize() method meant that even if an error
occurred during synchronization, we would still attempt finalize the
sync cycle (including potentially destructive operations such as
transforming the contact avatars stored in the database).

This commit ensures that we treat an earlier error as if the sync
was aborted.

Contributes to JB#38210
  • Loading branch information
Chris Adams committed Nov 8, 2018
1 parent 9db57f3 commit 95b26f6
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -815,7 +815,9 @@ void GoogleTwoWayContactSyncAdaptor::purgeAccount(int pid)

void GoogleTwoWayContactSyncAdaptor::finalize(int accountId)
{
if (m_accessTokens[accountId].isEmpty() || syncAborted()) {
if (m_accessTokens[accountId].isEmpty()
|| syncAborted()
|| status() == SocialNetworkSyncAdaptor::Error) {
// account failure occurred before sync process was started,
// or other error occurred during sync.
// in this case we have nothing left to do except cleanup.
Expand Down

0 comments on commit 95b26f6

Please sign in to comment.