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 { ...@@ -902,6 +902,9 @@ class BackendZarafa implements IBackend, ISearchProvider {
* @return array * @return array
*/ */
public function ChangesSink($timeout = 30) { public function ChangesSink($timeout = 30) {
// clear the folder stats cache
unset($this->folderStatCache);
$notifications = array(); $notifications = array();
$hierarchyNotifications = array(); $hierarchyNotifications = array();
$sinkresult = @mapi_sink_timedwait($this->changesSink, $timeout * 1000); $sinkresult = @mapi_sink_timedwait($this->changesSink, $timeout * 1000);
......
...@@ -503,7 +503,7 @@ class SyncCollections implements Iterator { ...@@ -503,7 +503,7 @@ class SyncCollections implements Iterator {
if (!empty($classes)) { if (!empty($classes)) {
// initialize all possible folders // initialize all possible folders
foreach ($this->collections as $folderid => $spa) { foreach ($this->collections as $folderid => $spa) {
if ($onlyPingable && $spa->GetPingableFlag() !== true) if (($onlyPingable && $spa->GetPingableFlag() !== true) || ! $folderid)
continue; continue;
// get the user store if this is a additional folder // get the user store if this is a additional folder
......
...@@ -602,6 +602,14 @@ class Sync extends RequestProcessor { ...@@ -602,6 +602,14 @@ class Sync extends RequestProcessor {
if (!$sc->HasCollections()) if (!$sc->HasCollections())
$status = SYNC_STATUS_SYNCREQUESTINCOMPLETE; $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 // HEARTBEAT & Empty sync
if ($status == SYNC_STATUS_SUCCESS && (isset($hbinterval) || $emptysync == true)) { 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