Two bugs:
- The change filed are not considered as move, they are re-downloaded
but the old file was not removed from the database. The change in
owncloudpropagator.cpp takes care of removing the old entries.
- Next sync would then remove the file in the server in the old folder
This was not a problem until we start reusing the sync engine, and
that the _renamedFolders map is not cleared. We were before deleting
a non-existing file. But now we delete the actual file.
Also improve the tests to be able to do move on the server.
This include support for file id.
Issue #5192
(cherry picked from commit
85b8ab178e21cf4dcaf792f68c15e55f6e0ee3c2)
bool ok = true;
if (!_item->isEmpty() && _hasError == SyncFileItem::NoStatus) {
if( !_item->_renameTarget.isEmpty() ) {
+ if(_item->_instruction == CSYNC_INSTRUCTION_RENAME
+ && _item->_originalFile != _item->_renameTarget) {
+ // Remove the stale entries from the database.
+ _propagator->_journal->deleteFileRecord(_item->_originalFile, true);
+ }
+
_item->_file = _item->_renameTarget;
}
bool walkOk = true;
_seenFiles.clear();
_temporarilyUnavailablePaths.clear();
+ _renamedFolders.clear();
if( csync_walk_local_tree(_csync_ctx, &treewalkLocal, 0) < 0 ) {
qDebug() << "Error in local treewalk.";