only use VFS update instruction when sync engine would do nothing
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 19 Jun 2024 17:05:13 +0000 (19:05 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 20 Jun 2024 06:44:00 +0000 (08:44 +0200)
will ensure we do not erroneously use this instruction when we should
not

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/discovery.cpp

index ccfb0c25f982efac89feffbbaa267efe4dba3b82..2cd501a291aa3a520216106c53d79b14a037182e 100644 (file)
@@ -1681,8 +1681,9 @@ void ProcessDirectoryJob::processFileFinalize(
     }
 
     if (_discoveryData->_syncOptions._vfs &&
-        item->_type == CSyncEnums::ItemTypeFile &&
-        !_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;
     }