Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schuster <48932272+misch7@users.noreply.github.com>2020-07-10 02:47:37 +0300
committerGitHub <noreply@github.com>2020-07-10 02:47:37 +0300
commit8a38e820a6694dfb15b03a123a4775fe0be70f15 (patch)
tree6c15b429d5d44477037c2d11bc8cc79df4ec1a9a
parentcba879e2af536c14b5feaa4fa9313127dc8072df (diff)
parent475267aff4f7f5880a4a489bfba233961cf02dd5 (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.cpp10
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;