as a last resort, try to update VFS metadata of folders when discovered
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 30 Apr 2024 11:33:58 +0000 (13:33 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 16 Sep 2024 15:32:53 +0000 (15:32 +0000)
when doing local discovery, it is possible that files or folders may be
discovered with VFS metadata not up to date (i.e. placeholder file not
set in sync)

in such case, generate a propagation instruction to set them in sync

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

index efb221c150e3aeae59ca06224b74101d34907e27..6eb2eefd755e159b47604609961f924d0dfcc741 100644 (file)
@@ -1719,7 +1719,7 @@ void ProcessDirectoryJob::processFileFinalize(
     }
 
     if (_discoveryData->_syncOptions._vfs &&
-        item->_type == CSyncEnums::ItemTypeFile &&
+        (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;