Skip to content

Commit

Permalink
Fix Kolab <-> Horde_History sync marker: The 'sync' timestamp must be…
Browse files Browse the repository at this point in the history
… per folder

Otherwise one folder overwrites the sync marker of other folders.

We need to keep our own timestamp since the sync of a folder cache
might be successful but the history sync could fail (timeout etc).
  • Loading branch information
thomasjfox authored and mrubinsk committed Jun 5, 2015
1 parent 17d7809 commit 9efe5be
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -44,19 +44,22 @@ class Horde_Kolab_Storage_Data_Query_History_Cache
*/
public function synchronize($params = array())
{
$timestamp_key = 'Kolab_History_Sync:'.$this->data->getId();

if (isset($params['last_sync']) &&
($params['last_sync'] === false ||
$params['last_sync'] !== $this->history->getActionTimestamp(__CLASS__ , 'sync'))) {
$params['last_sync'] !== $this->history->getActionTimestamp($timestamp_key, 'sync'))) {
/**
* Ignore current changeset and do a full synchronization as we are
* out of sync
*/
unset($params['changes']);
}
// Sync. Base class takes care of UIDVALIDITY changes.
parent::synchronize($params);
if (isset($params['current_sync'])) {
$this->history->log(
__CLASS__ ,
$timestamp_key,
array('action' => 'sync', 'ts' => $params['current_sync']), true
);
}
Expand Down

0 comments on commit 9efe5be

Please sign in to comment.