Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Update sync timestamp after gcal sync. Co…
Browse files Browse the repository at this point in the history
…ntributes to MER#1392

Previously, we used to only set it if remote changes needed to be
applied to a local calendar. This commit ensures that we always update
the sync timestamp correctly after a successful sync, so that on the
next sync the upsync delta is calculated correctly.

Contributes to MER#1392
  • Loading branch information
Chris Adams committed Oct 28, 2015
1 parent 6e69b39 commit e052b68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/google/google-calendars/googlecalendarsyncadaptor.cpp
Expand Up @@ -2011,6 +2011,12 @@ void GoogleCalendarSyncAdaptor::applyRemoteChangesLocally(int accountId)
updateLocalCalendarNotebookEvents(accountId, updatedCalendarId);
m_storageNeedsSave = true;
}

// this becomes our new sync anchor. In theory there could be lost updates because this timestamp will be greater
// than the point at which we requested local changes; but the alternative is cache the timestamp at the point
// just before we request local changes, and in that case, on the next sync we would get local changes (including additions)
// reported for every remote change which was applied above...
m_newSinceTimestamp[accountId] = QDateTime::currentDateTimeUtc(); // next sync should get all local changes made after this point in time.
}

void GoogleCalendarSyncAdaptor::updateLocalCalendarNotebookEvents(int accountId, const QString &calendarId)
Expand Down Expand Up @@ -2178,10 +2184,4 @@ void GoogleCalendarSyncAdaptor::updateLocalCalendarNotebookEvents(int accountId,
m_storageNeedsSave = true;
}
}

// this becomes our new sync anchor. In theory there could be lost updates because this timestamp will be greater
// than the point at which we requested local changes; but the alternative is cache the timestamp at the point
// just before we request local changes, and in that case, on the next sync we would get local changes (including additions)
// reported for every remote change which was applied above...
m_newSinceTimestamp[accountId] = QDateTime::currentDateTimeUtc(); // next sync should get all local changes made after this point in time.
}

0 comments on commit e052b68

Please sign in to comment.