diff --git a/lib/ext/Syncroton/Command/Sync.php b/lib/ext/Syncroton/Command/Sync.php --- a/lib/ext/Syncroton/Command/Sync.php +++ b/lib/ext/Syncroton/Command/Sync.php @@ -964,6 +964,12 @@ } $totalChanges += $collectionChanges; + + // If the client resent an old sync-key, we should still respond with the latest sync key + if (isset($collectionData->syncState->counterNext)) { + //TODO we're not resending the changes in between, but I'm not sure we have to. + $collectionData->syncState->counter = $collectionData->syncState->counterNext; + } // increase SyncKey if needed if (( diff --git a/lib/kolab_sync_backend_state.php b/lib/kolab_sync_backend_state.php --- a/lib/kolab_sync_backend_state.php +++ b/lib/kolab_sync_backend_state.php @@ -41,6 +41,7 @@ */ public function create($object, $keep_previous_state = true) { + unset($object->counterNext); $object = parent::create($object); if ($keep_previous_state !== true) { @@ -184,6 +185,7 @@ if ($next > $sync_key) { // We store the clientIdMap with the "next" sync state, so we need to copy it back. $state->clientIdMap = $states[$next]->clientIdMap; + $state->counterNext = $next; } else { // finally delete all entries marked for removal in syncroton_content table $retryCounter = 0;