diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-25 14:37:37 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-01-25 14:37:37 +0100 |
commit | 43e282c172c4b5604a4f0d9b70976fc0df00120f (patch) | |
tree | 658046eb73c1c31d30d942821f08e7bb68083f55 | |
parent | 3fc8ce958fc244e64a3a3a92f3b1440aae04133b (diff) | |
download | sink-43e282c172c4b5604a4f0d9b70976fc0df00120f.tar.gz sink-43e282c172c4b5604a4f0d9b70976fc0df00120f.zip |
debug output, fixed dummyresourcetest
-rw-r--r-- | common/storage_lmdb.cpp | 7 | ||||
-rw-r--r-- | dummyresource/resourcefactory.cpp | 1 | ||||
-rw-r--r-- | synchronizer/listener.cpp | 1 | ||||
-rw-r--r-- | tests/dummyresourcetest.cpp | 7 |
4 files changed, 14 insertions, 2 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index b7fbfed..98c1032 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -169,6 +169,13 @@ bool Storage::startTransaction(AccessMode type) | |||
169 | rc = mdb_txn_begin(d->env, NULL, requestedRead ? MDB_RDONLY : 0, &d->transaction); | 169 | rc = mdb_txn_begin(d->env, NULL, requestedRead ? MDB_RDONLY : 0, &d->transaction); |
170 | if (!rc) { | 170 | if (!rc) { |
171 | rc = mdb_dbi_open(d->transaction, NULL, d->allowDuplicates ? MDB_DUPSORT : 0, &d->dbi); | 171 | rc = mdb_dbi_open(d->transaction, NULL, d->allowDuplicates ? MDB_DUPSORT : 0, &d->dbi); |
172 | if (rc) { | ||
173 | qWarning() << "Error while opening transaction: " << mdb_strerror(rc); | ||
174 | } | ||
175 | } else { | ||
176 | if (rc) { | ||
177 | qWarning() << "Error while beginning transaction: " << mdb_strerror(rc); | ||
178 | } | ||
172 | } | 179 | } |
173 | 180 | ||
174 | d->firstOpen = false; | 181 | d->firstOpen = false; |
diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index f510cd5..3180b9a 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp | |||
@@ -397,6 +397,7 @@ Async::Job<void> DummyResource::processAllMessages() | |||
397 | return Async::start<void>([this](Async::Future<void> &f) { | 397 | return Async::start<void>([this](Async::Future<void> &f) { |
398 | //We have to wait for all items to be processed to ensure the synced items are available when a query gets executed. | 398 | //We have to wait for all items to be processed to ensure the synced items are available when a query gets executed. |
399 | //TODO: report errors while processing sync? | 399 | //TODO: report errors while processing sync? |
400 | //TODO: also check user-queue? | ||
400 | if (mSynchronizerQueue.isEmpty()) { | 401 | if (mSynchronizerQueue.isEmpty()) { |
401 | f.setFinished(); | 402 | f.setFinished(); |
402 | } else { | 403 | } else { |
diff --git a/synchronizer/listener.cpp b/synchronizer/listener.cpp index 6098856..147ed9f 100644 --- a/synchronizer/listener.cpp +++ b/synchronizer/listener.cpp | |||
@@ -309,6 +309,7 @@ void Listener::refreshRevision() | |||
309 | 309 | ||
310 | void Listener::updateClientsWithRevision() | 310 | void Listener::updateClientsWithRevision() |
311 | { | 311 | { |
312 | //FIXME don't send revision updates for revisions that are still being processed. | ||
312 | auto command = Akonadi2::CreateRevisionUpdate(m_fbb, m_pipeline->storage().maxRevision()); | 313 | auto command = Akonadi2::CreateRevisionUpdate(m_fbb, m_pipeline->storage().maxRevision()); |
313 | Akonadi2::FinishRevisionUpdateBuffer(m_fbb, command); | 314 | Akonadi2::FinishRevisionUpdateBuffer(m_fbb, command); |
314 | 315 | ||
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 5508452..6548659 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -34,6 +34,7 @@ private Q_SLOTS: | |||
34 | 34 | ||
35 | void cleanup() | 35 | void cleanup() |
36 | { | 36 | { |
37 | //TODO kill the synchronizer first? | ||
37 | removeFromDisk("org.kde.dummy"); | 38 | removeFromDisk("org.kde.dummy"); |
38 | removeFromDisk("org.kde.dummy.userqueue"); | 39 | removeFromDisk("org.kde.dummy.userqueue"); |
39 | removeFromDisk("org.kde.dummy.synchronizerqueue"); | 40 | removeFromDisk("org.kde.dummy.synchronizerqueue"); |
@@ -111,7 +112,7 @@ private Q_SLOTS: | |||
111 | Akonadi2::Query query; | 112 | Akonadi2::Query query; |
112 | query.resources << "org.kde.dummy"; | 113 | query.resources << "org.kde.dummy"; |
113 | query.syncOnDemand = false; | 114 | query.syncOnDemand = false; |
114 | query.processAll = false; | 115 | query.processAll = true; |
115 | 116 | ||
116 | query.propertyFilter.insert("uid", "testuid"); | 117 | query.propertyFilter.insert("uid", "testuid"); |
117 | async::SyncListResult<Akonadi2::Domain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::Domain::Event>(query)); | 118 | async::SyncListResult<Akonadi2::Domain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::Domain::Event>(query)); |
@@ -131,8 +132,10 @@ private Q_SLOTS: | |||
131 | auto future = job.exec(); | 132 | auto future = job.exec(); |
132 | future.waitForFinished(); | 133 | future.waitForFinished(); |
133 | QVERIFY(!future.errorCode()); | 134 | QVERIFY(!future.errorCode()); |
134 | QTRY_VERIFY(future.isFinished()); | 135 | QVERIFY(future.isFinished()); |
135 | QVERIFY(!resource.error()); | 136 | QVERIFY(!resource.error()); |
137 | auto processAllMessagesFuture = resource.processAllMessages().exec(); | ||
138 | processAllMessagesFuture.waitForFinished(); | ||
136 | } | 139 | } |
137 | 140 | ||
138 | void testSyncAndFacade() | 141 | void testSyncAndFacade() |