Changeset View
Changeset View
Standalone View
Standalone View
common/changereplay.cpp
Context not available. | |||||
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; | ||
Context not available. |