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 @@ -830,6 +830,14 @@ $commands->appendChild($add); + $newContentStates[] = new Syncroton_Model_Content(array( + 'device_id' => $this->_device, + 'folder_id' => $collectionData->folder, + 'contentid' => $serverId, + 'creation_time' => $this->_syncTimeStamp, + 'creation_synckey' => $collectionData->syncState->counter + 1 + )); + $collectionChanges++; } catch (Syncroton_Exception_MemoryExhausted $seme) { // continue to next entry, as there is not enough memory left for the current entry @@ -844,16 +852,11 @@ $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " unable to convert entry to xml: " . $e->getMessage()); if ($this->_logger instanceof Zend_Log) $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " unable to convert entry to xml: " . $e->getTraceAsString()); + // We bump collectionChanges anyways to make sure the windowSize still applies. + $collectionChanges++; } // mark as sent to the client, even the conversion to xml might have failed - $newContentStates[] = new Syncroton_Model_Content(array( - 'device_id' => $this->_device, - 'folder_id' => $collectionData->folder, - 'contentid' => $serverId, - 'creation_time' => $this->_syncTimeStamp, - 'creation_synckey' => $collectionData->syncState->counter + 1 - )); unset($serverModifications['added'][$id]); } @@ -890,6 +893,8 @@ } catch (Exception $e) { if ($this->_logger instanceof Zend_Log) $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " unable to convert entry to xml: " . $e->getMessage()); + // We bump collectionChanges anyways to make sure the windowSize still applies. + $collectionChanges++; } unset($serverModifications['changed'][$id]); @@ -915,6 +920,8 @@ } catch (Exception $e) { if ($this->_logger instanceof Zend_Log) $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " unable to convert entry to xml: " . $e->getMessage()); + // We bump collectionChanges anyways to make sure the windowSize still applies. + $collectionChanges++; } unset($serverModifications['deleted'][$id]);