diff options
author | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2021-07-08 12:45:38 +0300 |
---|---|---|
committer | Matthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr> | 2021-07-09 15:37:47 +0300 |
commit | d2f2e3305a1d485a3cc67b6bf715fd16b68d1d84 (patch) | |
tree | 4498436f0b18c76c0e8e3f707b6cd84f51f05bee | |
parent | 4a8dba90c285b21fee909a8509fd0f1b63f07f31 (diff) |
avoid being stuck trying to create placeholder for existing file
id sync db think a file is cirtual (empty placeholder) but file system
has a real file (non empty file) once the server has a modified version
we can no longer update it
state of file on disk takes precedence over sync DB to allow recovery
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
-rw-r--r-- | src/libsync/discovery.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 062ed5251..bd39c6ae8 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -349,6 +349,10 @@ void ProcessDirectoryJob::processFile(PathTuple path, item->_previousSize = dbEntry._fileSize; item->_previousModtime = dbEntry._modtime; + if (dbEntry._modtime == localEntry.modtime && dbEntry._type == ItemTypeVirtualFile && localEntry.type == ItemTypeFile) { + item->_type = ItemTypeFile; + } + // The item shall only have this type if the db request for the virtual download // was successful (like: no conflicting remote remove etc). This decision is done // either in processFileAnalyzeRemoteInfo() or further down here. @@ -710,8 +714,9 @@ void ProcessDirectoryJob::processFileAnalyzeLocalInfo( item->_type = ItemTypeVirtualFile; } - if (dbEntry.isVirtualFile() && !virtualFileDownload) + if (dbEntry.isVirtualFile() && (!localEntry.isValid() || localEntry.isVirtualFile) && !virtualFileDownload) { item->_type = ItemTypeVirtualFile; + } _childModified |= serverModified; |