summaryrefslogtreecommitdiff
path: root/client/src/leap
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2015-08-20 11:27:40 -0300
committerdrebs <drebs@leap.se>2015-08-20 11:27:40 -0300
commit39eb29aac3da15b55ff32a1642b6038cfdeaf720 (patch)
treeb8f9865354c6c53240e3e8b3b0740431d04a3447 /client/src/leap
parent350dcff39721a6c94b597ce8191fb58d47308eca (diff)
[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.
Diffstat (limited to 'client/src/leap')
-rw-r--r--client/src/leap/soledad/client/http_target.py5
1 files changed, 5 insertions, 0 deletions
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)