Commit a974c65a authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #360 in ZP/z-push from...

Merge pull request #360 in ZP/z-push from bugfix/ZP-1040-if-devicedata-doesn-t-change-it-could to develop

* commit 'f57dd701':
  ZP-1040 Check if ASDevice->GetData returns any data before writing it to disk.

Conflicts:
	src/lib/utils/zpushadmin.php
parent 51386bd0
...@@ -201,7 +201,7 @@ class ZPushAdmin { ...@@ -201,7 +201,7 @@ class ZPushAdmin {
// save device data // save device data
try { try {
if ($device->IsNewDevice()) { if ($device->IsNewDevice() || $device->GetData() === false) {
ZLog::Write(LOGLEVEL_ERROR, sprintf("ZPushAdmin::WipeDevice(): data of user '%s' not synchronized on device '%s'. Aborting.", $user, $devid)); ZLog::Write(LOGLEVEL_ERROR, sprintf("ZPushAdmin::WipeDevice(): data of user '%s' not synchronized on device '%s'. Aborting.", $user, $devid));
return false; return false;
} }
...@@ -421,10 +421,11 @@ class ZPushAdmin { ...@@ -421,10 +421,11 @@ class ZPushAdmin {
// remove hierarchcache // remove hierarchcache
StateManager::UnLinkState($device, false); StateManager::UnLinkState($device, false);
if ($device->GetData() !== false) {
ZPush::GetStateMachine()->SetState($device->GetData(), $devid, IStateMachine::DEVICEDATA); ZPush::GetStateMachine()->SetState($device->GetData(), $devid, IStateMachine::DEVICEDATA);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZPushAdmin::ResyncDevice(): all folders synchronized to device '%s' of user '%s' marked to be re-synchronized.", $devid, $user)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("ZPushAdmin::ResyncDevice(): all folders synchronized to device '%s' of user '%s' marked to be re-synchronized.", $devid, $user));
} }
}
catch (StateNotFoundException $e) { catch (StateNotFoundException $e) {
ZLog::Write(LOGLEVEL_ERROR, sprintf("ZPushAdmin::ResyncDevice(): state for device '%s' of user '%s' can not be found or saved", $devid, $user)); ZLog::Write(LOGLEVEL_ERROR, sprintf("ZPushAdmin::ResyncDevice(): state for device '%s' of user '%s' can not be found or saved", $devid, $user));
return false; return false;
......
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