One byte placeholders assumption only holds for the suffix backend
authorKevin Ottens <kevin.ottens@nextcloud.com>
Fri, 18 Dec 2020 11:16:39 +0000 (12:16 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 30 Dec 2020 08:44:57 +0000 (09:44 +0100)
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/libsync/discovery.cpp

index 6bc3ba59262ca9f1d2a59ef13eeef7d9c01835ea..09f0dae2d085f762cf560bdc95c5bd75460d72b4 100644 (file)
@@ -860,8 +860,8 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo(
     auto postProcessLocalNew = [item, localEntry, this]() {
         if (localEntry.isVirtualFile) {
             // Remove the spurious file if it looks like a placeholder file
-            // (we know placeholder files contain " ")
-            if (localEntry.size <= 1) {
+            // (we know placeholder files contain " ", but only in the suffix case)
+            if (localEntry.size <= 1 || !isVfsWithSuffix()) {
                 qCWarning(lcDisco) << "Wiping virtual file without db entry for" << _currentFolder._local + "/" + localEntry.name;
                 item->_instruction = CSYNC_INSTRUCTION_REMOVE;
                 item->_direction = SyncFileItem::Down;