From 9b178c5bb2f39e4902ef99ff42064e25b1453904 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 11 Oct 2014 15:38:12 +0200 Subject: [PATCH] Sync engine: Do not write to the database too early It is possible that we have should_update_etag set to true for files that we also need to propagate. In which case we must not write to the DB too early as this could cause data loss. (cf: issue #2296) --- src/mirall/syncengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp index 3c68e08a77..ae0edf5765 100644 --- a/src/mirall/syncengine.cpp +++ b/src/mirall/syncengine.cpp @@ -402,7 +402,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote ) int re = 0; switch(file->instruction) { case CSYNC_INSTRUCTION_NONE: - if (file->should_update_etag && !item._isDirectory) { + if (remote && item._should_update_etag && !item._isDirectory && item._instruction == CSYNC_INSTRUCTION_NONE) { // Update the database now already (new fileid or etag or remotePerm) // Those are files that were detected as "resolved conflict". // They should have been a conflict because they both were new, or both