Skip to content

Commit

Permalink
Revert "Revert "Prevent the folder cache from being overwritten.""
Browse files Browse the repository at this point in the history
This reverts commit 5f3c55b.
  • Loading branch information
mrubinsk committed Aug 19, 2014
1 parent 5f3c55b commit 5f7e450
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Collections.php
Expand Up @@ -905,7 +905,13 @@ public function updateCache()
*/
public function save()
{
$this->_cache->save();
// HOTFIX. Need to check the timestamp to see if we should reload the
// folder cache before saving to ensure it isn't overwritten. See
// Bug: 13273
if (!$this->_cache->validateCache()) {
$this->_logger->info(sprintf('[%s] Updating the foldercache before saving.', $this->_procid));
$this->_cache->refreshFolderCache();
}
}

/**
Expand Down
12 changes: 12 additions & 0 deletions framework/ActiveSync/lib/Horde/ActiveSync/SyncCache.php
Expand Up @@ -682,6 +682,18 @@ public function clearFolders()
$this->_dirty['folders'] = true;
}

/**
* Refresh the folder cache from the backend.
*
* @since 2.18.0
*/
public function refreshFolderCache()
{
$cache = $this->_state->getSyncCache($this->_devid, $this->_user);
$this->_data['folders'] = $cache['folders'];
$this->_dirty['folders'] = false;
}

/**
* Update a folder entry in the cache.
*
Expand Down

0 comments on commit 5f7e450

Please sign in to comment.