From 1e5e9fa4526fd577b932795230569708f88efa8e Mon Sep 17 00:00:00 2001 From: alex-z Date: Mon, 11 Dec 2023 19:28:00 +0100 Subject: [PATCH] Bugfix. Do not treat item type change as metadata update. Signed-off-by: alex-z --- src/libsync/discovery.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index e2e6b8699728a..eb1686e5f608e 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -983,19 +983,21 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo( bool serverModified = item->_instruction == CSYNC_INSTRUCTION_NEW || item->_instruction == CSYNC_INSTRUCTION_SYNC || item->_instruction == CSYNC_INSTRUCTION_RENAME || item->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE; + const auto isTypeChange = item->_instruction == CSYNC_INSTRUCTION_TYPE_CHANGE; + qCDebug(lcDisco) << "File" << item->_file << "- servermodified:" << serverModified << "noServerEntry:" << noServerEntry; // Decay server modifications to UPDATE_METADATA if the local virtual exists bool hasLocalVirtual = localEntry.isVirtualFile || (_queryLocal == ParentNotChanged && dbEntry.isVirtualFile()); bool virtualFileDownload = item->_type == ItemTypeVirtualFileDownload; - if (serverModified && !virtualFileDownload && hasLocalVirtual) { + if (serverModified && !isTypeChange && !virtualFileDownload && hasLocalVirtual) { item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA; serverModified = false; item->_type = ItemTypeVirtualFile; } - if (dbEntry.isVirtualFile() && (!localEntry.isValid() || localEntry.isVirtualFile) && !virtualFileDownload) { + if (dbEntry.isVirtualFile() && (!localEntry.isValid() || localEntry.isVirtualFile) && !virtualFileDownload && !isTypeChange) { item->_type = ItemTypeVirtualFile; }