Propagator: Add entry with dummy etag on local mkdir. #2761

This commit is contained in:
Christian Kamm 2015-06-17 13:56:37 +02:00
parent c11358219a
commit 191d66fc6f

View file

@ -125,6 +125,17 @@ void PropagateLocalMkdir::start()
done( SyncFileItem::NormalError, tr("could not create directory %1").arg(newDirStr) ); done( SyncFileItem::NormalError, tr("could not create directory %1").arg(newDirStr) );
return; return;
} }
// Insert the directory into the database. The correct etag will be set later,
// once all contents have been propagated, because should_update_etag is true.
// Adding an entry with a dummy etag to the database still makes sense here
// so the database is aware that this folder exists even if the sync is aborted
// before the correct etag is stored.
SyncJournalFileRecord record(*_item, newDirStr);
record._etag = "_invalid_";
_propagator->_journal->setFileRecord(record);
_propagator->_journal->commit("localMkdir");
done(SyncFileItem::Success); done(SyncFileItem::Success);
} }