From 39eb29aac3da15b55ff32a1642b6038cfdeaf720 Mon Sep 17 00:00:00 2001 From: drebs Date: Thu, 20 Aug 2015 11:27:40 -0300 Subject: [bug] update target metadata after first receive After we receive one document from the target database, we have to update the target metadata or else we will not be able to succesfully return the new generation and transaction id of the target when receiving exactly one document during a sync. --- client/src/leap/soledad/client/http_target.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'client/src/leap/soledad') diff --git a/client/src/leap/soledad/client/http_target.py b/client/src/leap/soledad/client/http_target.py index cfc2247c..a6ef2b0d 100644 --- a/client/src/leap/soledad/client/http_target.py +++ b/client/src/leap/soledad/client/http_target.py @@ -508,6 +508,11 @@ class SoledadHTTPSyncTarget(SyncTarget): self._received_docs = 0 number_of_changes, ngen, ntrans = self._insert_received_doc(doc, 1, 1) + # update the target gen and trans_id in case a document was received + if ngen: + new_generation = ngen + new_transaction_id = ntrans + if defer_decryption: self._sync_decr_pool.start(number_of_changes) -- cgit v1.2.3