mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
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)
This commit is contained in:
parent
d491663143
commit
9b178c5bb2
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user