diff options
author | Michael Schuster <48932272+misch7@users.noreply.github.com> | 2020-07-10 02:47:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 02:47:37 +0300 |
commit | 8a38e820a6694dfb15b03a123a4775fe0be70f15 (patch) | |
tree | 6c15b429d5d44477037c2d11bc8cc79df4ec1a9a | |
parent | cba879e2af536c14b5feaa4fa9313127dc8072df (diff) | |
parent | 475267aff4f7f5880a4a489bfba233961cf02dd5 (diff) |
Merge pull request #2184 from nextcloud/backport/2183/stable-2.6
[stable-2.6] Prevent empty FileMap in local csync to be processed if folder not empty
-rw-r--r-- | src/libsync/syncengine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 8a9381cdc..8810c0677 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -973,6 +973,16 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult) _journal->commitIfNeededAndStartNewTransaction("Post discovery"); } + // FIXME: This is a reasonable safety check, but specifically just a hotfix. + // See: https://github.com/nextcloud/desktop/issues/1433 + // It's still unclear why we can get an empty FileMap even though folder isn't empty + // For now: Re-check if folder is really empty, if not bail out + if (_csync_ctx.data()->local.files.empty() && QDir(_localPath).entryInfoList(QDir::NoDotAndDotDot).count() > 0) { + qCWarning(lcEngine) << "Received local tree with empty FileMap but sync folder isn't empty. Won't reconcile."; + finalize(false); + return; + } + _progressInfo->_currentDiscoveredRemoteFolder.clear(); _progressInfo->_currentDiscoveredLocalFolder.clear(); _progressInfo->_status = ProgressInfo::Reconcile; |