From: Matthieu Gallien Date: Tue, 7 Dec 2021 14:16:38 +0000 (+0100) Subject: recover from local invalid modifie time: force download from server X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~17^2~253^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=791073bd28c9512c1a5f24353e89a598c20f694c;p=nextcloud-desktop.git recover from local invalid modifie time: force download from server force file download if local modified time is invalid and server has valid modified time Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index f67967025..b673d4c98 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -542,6 +542,19 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( } else { item->_instruction = CSYNC_INSTRUCTION_SYNC; } + } else if (dbEntry._modtime <= 0 && serverEntry.modtime > 0) { + item->_direction = SyncFileItem::Down; + item->_modtime = serverEntry.modtime; + item->_size = sizeOnServer; + if (serverEntry.isDirectory) { + ENFORCE(dbEntry.isDirectory()); + item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA; + } else if (!localEntry.isValid() && _queryLocal != ParentNotChanged) { + // Deleted locally, changed on server + item->_instruction = CSYNC_INSTRUCTION_NEW; + } else { + item->_instruction = CSYNC_INSTRUCTION_SYNC; + } } else if (dbEntry._remotePerm != serverEntry.remotePerm || dbEntry._fileId != serverEntry.fileId || metaDataSizeNeedsUpdateForE2EeFilePlaceholder) { if (metaDataSizeNeedsUpdateForE2EeFilePlaceholder) { // we are updating placeholder sizes after migrating from older versions with VFS + E2EE implicit hydration not supported