summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-20 16:55:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-20 16:55:21 +0200
commit227610b7399905fca38e0f09053d78e2e866f32e (patch)
tree133dbdfd137ada5833fa64bbf8c8873b91af82f9 /common/synchronizer.cpp
parentd67b886dd2cf51264e4d6da680e268015a0a7031 (diff)
downloadsink-227610b7399905fca38e0f09053d78e2e866f32e.tar.gz
sink-227610b7399905fca38e0f09053d78e2e866f32e.zip
Ensure change-replay errors make it through to the correct error
handling and are appropriately dealt with.
Diffstat (limited to 'common/synchronizer.cpp')
-rw-r--r--common/synchronizer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp
index 3ef7eb7..b1ff29c 100644
--- a/common/synchronizer.cpp
+++ b/common/synchronizer.cpp
@@ -629,11 +629,14 @@ KAsync::Job<void> Synchronizer::replay(const QByteArray &type, const QByteArray
629 } 629 }
630 }) 630 })
631 .then([this](const KAsync::Error &error) { 631 .then([this](const KAsync::Error &error) {
632 //We need to commit here otherwise the next change-replay step will abort the transaction
633 mSyncStore.clear();
634 mSyncTransaction.commit();
632 if (error) { 635 if (error) {
633 SinkWarningCtx(mLogCtx) << "Failed to replay change: " << error.errorMessage; 636 SinkWarningCtx(mLogCtx) << "Failed to replay change: " << error.errorMessage;
637 return KAsync::error(error);
634 } 638 }
635 mSyncStore.clear(); 639 return KAsync::null();
636 mSyncTransaction.commit();
637 }); 640 });
638} 641}
639 642