diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index c54ee269cf762..fbadcf2eca10c 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -1690,9 +1690,9 @@ void ProcessDirectoryJob::processFileFinalize( } if (_discoveryData->_syncOptions._vfs && - (item->_type == CSyncEnums::ItemTypeFile || item->_type == CSyncEnums::ItemTypeDirectory) && - item->_instruction == CSyncEnums::CSYNC_INSTRUCTION_NONE && - !_discoveryData->_syncOptions._vfs->isPlaceHolderInSync(_discoveryData->_localDir + path._local)) { + (item->_type == CSyncEnums::ItemTypeFile || item->_type == CSyncEnums::ItemTypeDirectory) && + item->_instruction == CSyncEnums::CSYNC_INSTRUCTION_NONE && + !_discoveryData->_syncOptions._vfs->isPlaceHolderInSync(_discoveryData->_localDir + path._local)) { item->_instruction = CSyncEnums::CSYNC_INSTRUCTION_UPDATE_VFS_METADATA; } diff --git a/src/libsync/propagateremotemove.cpp b/src/libsync/propagateremotemove.cpp index 09cb179d385a9..08222d095eb87 100644 --- a/src/libsync/propagateremotemove.cpp +++ b/src/libsync/propagateremotemove.cpp @@ -216,7 +216,19 @@ void PropagateRemoteMove::slotMoveJobFinished() qCWarning(lcPropagateRemoteMove) << "Could not MOVE file" << filePathOriginal << " to" << filePath << " with error:" << _job->errorString() << " and successfully restored it."; + + auto restoredItem = *_item; + restoredItem._renameTarget = _item->_originalFile; + const auto result = propagator()->updateMetadata(restoredItem); + if (!result) { + done(SyncFileItem::FatalError, tr("Error updating metadata: %1").arg(result.error()), ErrorCategory::GenericError); + return; + } else if (*result == Vfs::ConvertToPlaceholderResult::Locked) { + done(SyncFileItem::SoftError, tr("The file %1 is currently in use").arg(restoredItem._file), ErrorCategory::GenericError); + return; + } } + done(status, _job->errorString(), ErrorCategory::GenericError); return; }