Commit e756ecd2 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-840 Do not throw StateNotFoundException as this messes up Ping. Just

treat it as StateInvalid (which is true, FD indicates a state that is
not available), do not catch both types in Ping as only
StateInvalidException will be thrown.

Released under the Affero GNU General Public License (AGPL) version 3.
parent cc533ab9
......@@ -125,7 +125,7 @@ class SyncCollections implements Iterator {
*
* @access public
* @throws StatusException with SyncCollections::ERROR_WRONG_HIERARCHY if permission check fails
* @throws StateNotFoundException if the sync state can not be found ($loadState = true)
* @throws StateInvalidException if the sync state can not be found or relation between states is invalid ($loadState = true)
* @return boolean
*/
public function LoadAllCollections($overwriteLoaded = false, $loadState = false, $checkPermissions = false) {
......@@ -161,7 +161,7 @@ class SyncCollections implements Iterator {
*
* @access public
* @throws StatusException with SyncCollections::ERROR_WRONG_HIERARCHY if permission check fails
* @throws StateNotFoundException if the sync state can not be found ($loadState = true)
* @throws StateInvalidException if the sync state can not be found or relation between states is invalid ($loadState = true)
* @return boolean
*/
public function LoadCollection($folderid, $loadState = false, $checkPermissions = false) {
......@@ -206,8 +206,7 @@ class SyncCollections implements Iterator {
// make sure this folder is fully synched on next Sync request
$this->invalidateFolderStat($spa);
// rethrow the exception
throw $snfe;
return false;
}
}
......
......@@ -67,25 +67,19 @@ class Ping extends RequestProcessor {
try {
$sc->LoadAllCollections(true, true, true);
}
catch (StateNotFoundException $snfex) {
catch (StateInvalidException $snfex) {
// if no params are present, indicate to send params, else do hierarchy sync
if (!$params_present) {
$pingstatus = SYNC_PINGSTATUS_FAILINGPARAMS;
self::$topCollector->AnnounceInformation("StateNotFoundException: require PingParameters", true);
self::$topCollector->AnnounceInformation("StateInvalidException: require PingParameters", true);
}
else {
// 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) {
// 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("StateInvalidException: force sync", true);
self::$topCollector->AnnounceInformation("StateInvalidException: force sync", true);
}
}
catch (StatusException $stex) {
$pingstatus = SYNC_PINGSTATUS_FOLDERHIERSYNCREQUIRED;
......
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