[Pkg-owncloud-commits] [owncloud-client] 06/70: propagator: Ignore new directory inside removed directory.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Jul 1 10:21:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 7a7b0e89398935fd013093e7185fcbd95c9439ce
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Jun 4 16:37:46 2014 +0200

    propagator: Ignore new directory inside removed directory.
    
    This fixes te bug if one create a tree of folders and subfolders
    and delete them while they are uploading. Some folder would
    reappears
---
 src/mirall/owncloudpropagator.cpp | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index f08f02d..b8295cf 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -219,10 +219,23 @@ void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
     QVector<PropagatorJob*> directoriesToRemove;
     QString removedDirectory;
     foreach(const SyncFileItem &item, items) {
-        if (item._instruction == CSYNC_INSTRUCTION_REMOVE
-            && !removedDirectory.isEmpty() && item._file.startsWith(removedDirectory)) {
-            //already taken care of.  (by the removal of the parent directory)
-            continue;
+
+        if (!removedDirectory.isEmpty() && item._file.startsWith(removedDirectory)) {
+            // this is an item in a directory which is going to be removed.
+            if (item._instruction == CSYNC_INSTRUCTION_REMOVE) {
+                //already taken care of.  (by the removal of the parent directory)
+                continue;
+            } else if (item._instruction == CSYNC_INSTRUCTION_NEW && item._isDirectory) {
+                // create a new directory within a deleted directory? That can happen if the directory
+                // etag were not fetched properly on the previous sync because the sync was aborted
+                // while uploading this directory (which is now removed).  We can ignore it.
+                continue;
+            } else if (item._instruction == CSYNC_INSTRUCTION_IGNORE) {
+                continue;
+            }
+
+            qWarning() << "WARNING:  Job within a removed directory?  This should not happen!"
+                       << item._file << item._instruction;
         }
 
         while (!item.destination().startsWith(directories.top().first)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list