diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/synchronizer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index 51e53c8..037a01f 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp | |||
@@ -626,6 +626,19 @@ KAsync::Job<void> Synchronizer::replay(const QByteArray &type, const QByteArray | |||
626 | } | 626 | } |
627 | SinkLogCtx(mLogCtx) << "Replaying: " << key << "Type: " << type << "Uid: " << uid << "Rid: " << oldRemoteId << "Revision: " << metadataBuffer->revision(); | 627 | SinkLogCtx(mLogCtx) << "Replaying: " << key << "Type: " << type << "Uid: " << uid << "Rid: " << oldRemoteId << "Revision: " << metadataBuffer->revision(); |
628 | 628 | ||
629 | //If the entity has been removed already and this is not the removal, skip over. | ||
630 | //This is important so we can unblock changereplay by removing entities. | ||
631 | bool skipOver = false; | ||
632 | store().readLatest(type, uid, [&](const ApplicationDomain::ApplicationDomainType &, Sink::Operation latestOperation) { | ||
633 | if (latestOperation == Sink::Operation_Removal && operation != Sink::Operation_Removal) { | ||
634 | skipOver = true; | ||
635 | } | ||
636 | }); | ||
637 | if (skipOver) { | ||
638 | SinkLogCtx(mLogCtx) << "Skipping over already removed entity"; | ||
639 | return KAsync::null(); | ||
640 | } | ||
641 | |||
629 | KAsync::Job<QByteArray> job = KAsync::null<QByteArray>(); | 642 | KAsync::Job<QByteArray> job = KAsync::null<QByteArray>(); |
630 | //TODO This requires supporting every domain type here as well. Can we solve this better so we can do the dispatch somewhere centrally? | 643 | //TODO This requires supporting every domain type here as well. Can we solve this better so we can do the dispatch somewhere centrally? |
631 | if (type == ApplicationDomain::getTypeName<ApplicationDomain::Folder>()) { | 644 | if (type == ApplicationDomain::getTypeName<ApplicationDomain::Folder>()) { |