Commit b8563fb3 authored by chriadam's avatar chriadam

[buteo-sync-plugins-social] Properly store the mapping between gcalId and...

[buteo-sync-plugins-social] Properly store the mapping between gcalId and local UID. Contributes to JB#47783

Previously, we always stored an empty gcalId in the mapping.
This could result in "known" partial upsync artifacts being
ignored and re-upsynced, causing server-side event duplication.
parent f058f4bb
......@@ -1691,8 +1691,8 @@ QList<GoogleCalendarSyncAdaptor::UpsyncChange> GoogleCalendarSyncAdaptor::determ
QString gcalId = gCalEventId(incidence);
if (gcalId.isEmpty() && upsyncedUidMapping.contains(incidence->uid())) {
// partially upsynced artifact. It may need to be updated with gcalId comment field.
partialUpsyncArtifactsNeedingUpdate.insert(gcalId);
gcalId = upsyncedUidMapping.value(incidence->uid());
partialUpsyncArtifactsNeedingUpdate.insert(gcalId);
}
if (gcalId.size() && eventPtr) {
SOCIALD_LOG_TRACE("Have local event:" << gcalId << "," << eventPtr->uid() << ":" << eventPtr->recurrenceId().toString());
......@@ -1945,6 +1945,9 @@ QList<GoogleCalendarSyncAdaptor::UpsyncChange> GoogleCalendarSyncAdaptor::determ
SOCIALD_LOG_DEBUG("Discarding partial upsync artifact local addition:" << eventId);
discardedLocalAdditions++;
continue;
} else {
// should never be hit. bug in plugin code.
SOCIALD_LOG_ERROR("Not discarding partial upsync artifact local addition due to data inconsistency:" << eventId);
}
}
QString gcalId = gCalEventId(event);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment