diff options
author | Minijackson <minijackson@riseup.net> | 2018-08-21 12:03:40 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-08-21 14:04:56 +0200 |
commit | 23e13c91e44e9d1fcbe2215f16d10117de4d0e84 (patch) | |
tree | 6e341ca4bcb94499a9b9631b7b3499a691d30b79 /common/changereplay.cpp | |
parent | 40fbc56ba745322ed75ac12c5551ce6b9bcb1cc4 (diff) | |
download | sink-23e13c91e44e9d1fcbe2215f16d10117de4d0e84.tar.gz sink-23e13c91e44e9d1fcbe2215f16d10117de4d0e84.zip |
Separate UIDs and revisions
Diffstat (limited to 'common/changereplay.cpp')
-rw-r--r-- | common/changereplay.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/changereplay.cpp b/common/changereplay.cpp index d7f46dc..96162b8 100644 --- a/common/changereplay.cpp +++ b/common/changereplay.cpp | |||
@@ -116,16 +116,15 @@ KAsync::Job<void> ChangeReplay::replayNextRevision() | |||
116 | } else { | 116 | } else { |
117 | // TODO: should not use internal representations | 117 | // TODO: should not use internal representations |
118 | const auto key = Storage::Key(Storage::Identifier::fromDisplayByteArray(uid), revision); | 118 | const auto key = Storage::Key(Storage::Identifier::fromDisplayByteArray(uid), revision); |
119 | const auto internalKey = key.toInternalByteArray(); | ||
120 | const auto displayKey = key.toDisplayByteArray(); | 119 | const auto displayKey = key.toDisplayByteArray(); |
121 | QByteArray entityBuffer; | 120 | QByteArray entityBuffer; |
122 | DataStore::mainDatabase(mMainStoreTransaction, type) | 121 | DataStore::mainDatabase(mMainStoreTransaction, type) |
123 | .scan(internalKey, | 122 | .scan(revision, |
124 | [&entityBuffer](const QByteArray &key, const QByteArray &value) -> bool { | 123 | [&entityBuffer](const size_t, const QByteArray &value) -> bool { |
125 | entityBuffer = value; | 124 | entityBuffer = value; |
126 | return false; | 125 | return false; |
127 | }, | 126 | }, |
128 | [this, key](const DataStore::Error &) { SinkErrorCtx(mLogCtx) << "Failed to read the entity buffer " << key; }); | 127 | [this, key](const DataStore::Error &e) { SinkErrorCtx(mLogCtx) << "Failed to read the entity buffer " << key << "error:" << e; }); |
129 | 128 | ||
130 | if (entityBuffer.isEmpty()) { | 129 | if (entityBuffer.isEmpty()) { |
131 | SinkErrorCtx(mLogCtx) << "Failed to replay change " << key; | 130 | SinkErrorCtx(mLogCtx) << "Failed to replay change " << key; |