summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-10 16:18:10 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-04-10 16:18:10 +0200
commit4f6d324285aec8df66d341243bcf0bc09c240c02 (patch)
tree3635eee533ad80791a37d6ddd862686736951bd5
parent39b3b6c7ff99f18e8719b28d748ec63adf76808d (diff)
downloadsink-4f6d324285aec8df66d341243bcf0bc09c240c02.tar.gz
sink-4f6d324285aec8df66d341243bcf0bc09c240c02.zip
Less noise
-rw-r--r--common/synchronizer.cpp12
-rw-r--r--common/synchronizerstore.cpp3
2 files changed, 7 insertions, 8 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp
index fcd135c..3e7bd30 100644
--- a/common/synchronizer.cpp
+++ b/common/synchronizer.cpp
@@ -589,21 +589,19 @@ KAsync::Job<void> Synchronizer::replay(const QByteArray &type, const QByteArray
589 return job.then([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) { 589 return job.then([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) {
590 if (operation == Sink::Operation_Creation) { 590 if (operation == Sink::Operation_Creation) {
591 SinkTraceCtx(mLogCtx) << "Replayed creation with remote id: " << remoteId; 591 SinkTraceCtx(mLogCtx) << "Replayed creation with remote id: " << remoteId;
592 if (remoteId.isEmpty()) { 592 if (!remoteId.isEmpty()) {
593 SinkWarningCtx(mLogCtx) << "Returned an empty remoteId from the creation";
594 } else {
595 syncStore().recordRemoteId(type, uid, remoteId); 593 syncStore().recordRemoteId(type, uid, remoteId);
596 } 594 }
597 } else if (operation == Sink::Operation_Modification) { 595 } else if (operation == Sink::Operation_Modification) {
598 SinkTraceCtx(mLogCtx) << "Replayed modification with remote id: " << remoteId; 596 SinkTraceCtx(mLogCtx) << "Replayed modification with remote id: " << remoteId;
599 if (remoteId.isEmpty()) { 597 if (!remoteId.isEmpty()) {
600 SinkWarningCtx(mLogCtx) << "Returned an empty remoteId from the modification";
601 } else {
602 syncStore().updateRemoteId(type, uid, remoteId); 598 syncStore().updateRemoteId(type, uid, remoteId);
603 } 599 }
604 } else if (operation == Sink::Operation_Removal) { 600 } else if (operation == Sink::Operation_Removal) {
605 SinkTraceCtx(mLogCtx) << "Replayed removal with remote id: " << oldRemoteId; 601 SinkTraceCtx(mLogCtx) << "Replayed removal with remote id: " << oldRemoteId;
606 syncStore().removeRemoteId(type, uid, oldRemoteId); 602 if (!oldRemoteId.isEmpty()) {
603 syncStore().removeRemoteId(type, uid, oldRemoteId);
604 }
607 } else { 605 } else {
608 SinkErrorCtx(mLogCtx) << "Unkown operation" << operation; 606 SinkErrorCtx(mLogCtx) << "Unkown operation" << operation;
609 } 607 }
diff --git a/common/synchronizerstore.cpp b/common/synchronizerstore.cpp
index dea4821..5364094 100644
--- a/common/synchronizerstore.cpp
+++ b/common/synchronizerstore.cpp
@@ -73,7 +73,8 @@ QByteArray SynchronizerStore::resolveLocalId(const QByteArray &bufferType, const
73{ 73{
74 QByteArray remoteId = Index("localid.mapping." + bufferType, mTransaction).lookup(localId); 74 QByteArray remoteId = Index("localid.mapping." + bufferType, mTransaction).lookup(localId);
75 if (remoteId.isEmpty()) { 75 if (remoteId.isEmpty()) {
76 SinkWarning() << "Couldn't find the remote id for " << bufferType << localId; 76 //This can happen if we didn't store the remote id in the first place
77 SinkTrace() << "Couldn't find the remote id for " << bufferType << localId;
77 return QByteArray(); 78 return QByteArray();
78 } 79 }
79 return remoteId; 80 return remoteId;