Commit 0209e19b authored by Manfred Kutas's avatar Manfred Kutas

ZP-622 Devices performing heartbeat weren't handling changes properly.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 9ef235b4
......@@ -902,6 +902,9 @@ class BackendZarafa implements IBackend, ISearchProvider {
* @return array
*/
public function ChangesSink($timeout = 30) {
// clear the folder stats cache
unset($this->folderStatCache);
$notifications = array();
$hierarchyNotifications = array();
$sinkresult = @mapi_sink_timedwait($this->changesSink, $timeout * 1000);
......
......@@ -503,7 +503,7 @@ class SyncCollections implements Iterator {
if (!empty($classes)) {
// initialize all possible folders
foreach ($this->collections as $folderid => $spa) {
if ($onlyPingable && $spa->GetPingableFlag() !== true)
if (($onlyPingable && $spa->GetPingableFlag() !== true) || ! $folderid)
continue;
// get the user store if this is a additional folder
......
......@@ -602,6 +602,14 @@ class Sync extends RequestProcessor {
if (!$sc->HasCollections())
$status = SYNC_STATUS_SYNCREQUESTINCOMPLETE;
}
else {
// load the hierarchy data - there are no permissions to verify so we just set it to false
if (!$sc->LoadCollection(false, true, false)) {
$status = SYNC_STATUS_FOLDERHIERARCHYCHANGED;
self::$topCollector->AnnounceInformation(sprintf("StatusException code: %d", $status), $this->singleFolder);
$this->saveMultiFolderInfo("exeption", "StatusException");
}
}
// HEARTBEAT & Empty sync
if ($status == SYNC_STATUS_SUCCESS && (isset($hbinterval) || $emptysync == true)) {
......
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