[Pkg-owncloud-commits] [owncloud-client] 05/70: propagator: do not update perent directory etag before sub directories are removed

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 a4f63707743f078b9d157e48dcddcf8461784d8a
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Jun 4 12:31:30 2014 +0200

    propagator:  do not update perent directory etag before sub directories are removed
    
    Direcotries are removed at the end, and we don't want to update
    parent directory etag before the delete is performed, or the next
    sync may read from db and think the files are not removed.
    
    Issue #1845
---
 src/mirall/owncloudpropagator.cpp | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index 52a6864..f08f02d 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -233,11 +233,21 @@ void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
             PropagateDirectory *dir = new PropagateDirectory(this, item);
             dir->_firstJob.reset(createJob(item));
             if (item._instruction == CSYNC_INSTRUCTION_REMOVE) {
-                //We do the removal of directories at the end
+                //We do the removal of directories at the end, because there might be moves from
+                // this directories that will happen later.
                 directoriesToRemove.append(dir);
                 removedDirectory = item._file + "/";
+
+                // We should not update the etag of parent directories of the removed directory
+                // since it would be done before the actual remove (issue #1845)
+                // NOTE: Currently this means that we don't update those etag at all in this sync,
+                //       but it should not be a problem, they will be updated in the next sync.
+                for (int i = 0; i < directories.size(); ++i) {
+                    directories[i].second->_item._should_update_etag = false;
+                }
             } else {
-                directories.top().second->append(dir);
+                PropagateDirectory* currentDirJob = directories.top().second;
+                currentDirJob->append(dir);
             }
             directories.push(qMakePair(item.destination() + "/" , dir));
         } else if (PropagateItemJob* current = createJob(item)) {

-- 
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