Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Properly store the mapping between gcalId…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
Chris Adams committed Jan 29, 2020
1 parent f058f4b commit b8563fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/google/google-calendars/googlecalendarsyncadaptor.cpp
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b8563fb

Please sign in to comment.