Commit 74f04e4c authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-952 Don't try to convert folderid if this is a hierarchy

notification.

Released under the Affero GNU General Public License (AGPL) version 3.
parent a5fbfc1e
......@@ -594,25 +594,28 @@ class SyncCollections implements Iterator {
$validNotifications = false;
foreach ($notifications as $backendFolderId) {
// the backend will notify on the backend folderid
$folderid = ZPush::GetDeviceManager()->GetFolderIdForBackendId($backendFolderId);
// Check hierarchy notifications
if ($folderid === IBackend::HIERARCHYNOTIFICATION) {
// wait two seconds before validating this notification, because it could potentially be made by the mobile and we need some time to update the states.
sleep(2);
// check received hierarchy notifications by exporting
if ($this->countHierarchyChange(true))
if ($this->countHierarchyChange(true)) {
throw new StatusException("SyncCollections->CheckForChanges(): HierarchySync required.", self::HIERARCHY_CHANGED);
}
// check if the notification on the folder is within our filter
else if ($this->CountChange($folderid)) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->CheckForChanges(): Notification received on folder '%s'", $folderid));
$validNotifications = true;
$this->waitingTime = time()-$started;
}
}
else {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->CheckForChanges(): Notification received on folder '%s', but it is not relevant", $folderid));
// the backend will notify on the backend folderid
$folderid = ZPush::GetDeviceManager()->GetFolderIdForBackendId($backendFolderId);
// check if the notification on the folder is within our filter
if ($this->CountChange($folderid)) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->CheckForChanges(): Notification received on folder '%s'", $folderid));
$validNotifications = true;
$this->waitingTime = time()-$started;
}
else {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->CheckForChanges(): Notification received on folder '%s', but it is not relevant", $folderid));
}
}
}
if ($validNotifications)
......
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