Commit 0a7587a4 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-840 On StateNotFoundException of the exporter state generate a fake

change so Ping indicates the synchronization of the folder.

Change should be directly mergable into release/2.2.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 5f7d4562
......@@ -194,8 +194,19 @@ class SyncCollections implements Iterator {
$addStatus = $this->AddCollection($spa);
// load the latest known syncstate if requested
if ($addStatus && $loadState === true)
$this->addparms[$folderid]["state"] = $this->stateManager->GetSyncState($spa->GetLatestSyncKey());
if ($addStatus && $loadState === true) {
try {
$this->addparms[$folderid]["state"] = $this->stateManager->GetSyncState($spa->GetLatestSyncKey());
}
catch (StateNotFoundException $snfe) {
// if we can't find the state, first we should try a sync of that folder, so
// we generate a fake change, so a sync on this folder is triggered
$this->changes[$folderid] = 1;
// rethrow the exception
throw $snfe;
}
}
return $addStatus;
}
......
......@@ -74,8 +74,10 @@ class Ping extends RequestProcessor {
self::$topCollector->AnnounceInformation("StateNotFoundException: require PingParameters", true);
}
else {
$pingstatus = SYNC_PINGSTATUS_FOLDERHIERSYNCREQUIRED;
self::$topCollector->AnnounceInformation("StateNotFoundException: require HierarchySync", true);
// we do not have a ping status for this, but SyncCollections should have generated fake changes for the folders which are broken
$fakechanges = $sc->GetChangedFolderIds();
$foundchanges = true;
self::$topCollector->AnnounceInformation("StateNotFoundException: force sync", true);
}
}
catch (StateInvalidException $snfex) {
......
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