summaryrefslogtreecommitdiffstats
path: root/common/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r--common/pipeline.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp
index 4afe9f3..cbdc91d 100644
--- a/common/pipeline.cpp
+++ b/common/pipeline.cpp
@@ -258,7 +258,19 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size)
258 return KAsync::error<qint64>(0); 258 return KAsync::error<qint64>(0);
259 } 259 }
260 260
261 auto newEntity = d->entityStore.applyDiff(bufferType, current, diff, deletions); 261 //We avoid overwriting local changes that haven't been played back yet with remote modifications
262 QSet<QByteArray> excludeProperties;
263 if (!replayToSource) { //We assume this means the change is coming from the source already
264 d->entityStore.readRevisions(bufferType, diff.identifier(), baseRevision, [&] (const QByteArray &uid, qint64 revision, const Sink::EntityBuffer &entity) {
265 if (entity.metadataBuffer()) {
266 if (auto metadata = GetMetadata(entity.metadataBuffer())) {
267 excludeProperties += BufferUtils::fromVector(*metadata->modifiedProperties()).toSet();
268 }
269 }
270 });
271 }
272
273 auto newEntity = d->entityStore.applyDiff(bufferType, current, diff, deletions, excludeProperties);
262 274
263 bool isMove = false; 275 bool isMove = false;
264 if (modifyEntity->targetResource()) { 276 if (modifyEntity->targetResource()) {