Skip to content

Commit

Permalink
[sociald] Ensure that we purge partial-sync state data on account del…
Browse files Browse the repository at this point in the history
…etion. Contributes to JB#18789

The latest version of qtcontacts-sqlite stores partial-sync state
data to prevent uploading or downloading duplicates.  This commit
ensures that any such data is cleared from OOB when the account
is removed to avoid possible issues related to backup/restore.

Contributes to JB#18789
  • Loading branch information
Chris Adams committed Apr 30, 2014
1 parent 178b634 commit afab563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rpm/sociald.spec
Expand Up @@ -243,7 +243,7 @@ Summary: Provides contact synchronisation with Google
License: TBD
Group: System/Libraries
BuildRequires: pkgconfig(Qt5Contacts)
BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) >= 0.1.54
BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions) >= 0.1.58
Requires: %{name} = %{version}-%{release}

%description google-contacts
Expand Down
5 changes: 3 additions & 2 deletions src/google/google-contacts/googletwowaycontactsyncadaptor.cpp
Expand Up @@ -795,7 +795,9 @@ void GoogleTwoWayContactSyncAdaptor::purgeAccount(int pid)
QStringList purgeKeys;
// purge the "build-in" OOB keys
purgeKeys << QStringLiteral("prevRemote") << QStringLiteral("exportedIds")
<< QStringLiteral("remoteSince") << QStringLiteral("localSince");
<< QStringLiteral("remoteSince") << QStringLiteral("localSince")
<< QStringLiteral("possiblyUploadedAdditions")
<< QStringLiteral("definitelyDownloadedAdditions");
// purge the extra OOB keys
purgeKeys << QStringLiteral("myContactsGroupAtomId")
<< QStringLiteral("unsupportedElements")
Expand Down Expand Up @@ -883,7 +885,6 @@ void GoogleTwoWayContactSyncAdaptor::finalize(int accountId)
TRACE(SOCIALD_ERROR,
QString(QLatin1String("unable to finalize sync of Google contacts with account %1"))
.arg(accountId));

purgeSyncStateData(QString::number(accountId));
setStatus(SocialNetworkSyncAdaptor::Error);
}
Expand Down

0 comments on commit afab563

Please sign in to comment.