diff options
author | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2021-12-07 17:16:38 +0300 |
---|---|---|
committer | Matthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr> | 2021-12-08 10:22:24 +0300 |
commit | 791073bd28c9512c1a5f24353e89a598c20f694c (patch) | |
tree | eab8ea625db72c4e43079097c8639c14a56fe46a /src/libsync | |
parent | 41c86d645994849b9732becff40cd2b90ad55ff6 (diff) |
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 <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src/libsync')
-rw-r--r-- | src/libsync/discovery.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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 |