summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-10-29 12:08:33 -0400
committerKali Kaneko <kali@leap.se>2015-10-29 12:08:33 -0400
commite8845671a4e479e207dde93d1d384e788aa73df1 (patch)
tree80ba755e2fa5efb94ba5ada76b27e97adf919dfe /client
parentb56d8db6e5dee0eccfa5c5a43c2e1b744a4eceac (diff)
parent2c5c7f58b796fc9f71c4279a2d3f5fa062ef2533 (diff)
Merge tag '0.7.4' into debian/experimental
Tag leap.soledad version 0.7.4
Diffstat (limited to 'client')
-rw-r--r--client/src/leap/soledad/client/api.py2
-rw-r--r--client/src/leap/soledad/client/http_target/__init__.py6
-rw-r--r--client/src/leap/soledad/client/sync.py14
3 files changed, 17 insertions, 5 deletions
diff --git a/client/src/leap/soledad/client/api.py b/client/src/leap/soledad/client/api.py
index a558addd..8c5f7f1b 100644
--- a/client/src/leap/soledad/client/api.py
+++ b/client/src/leap/soledad/client/api.py
@@ -723,7 +723,7 @@ class Soledad(object):
return passthrough
d.addCallbacks(_sync_callback, _sync_errback)
- d.addBoth(_emit_done_data_sync)
+ d.addCallback(_emit_done_data_sync)
return d
@property
diff --git a/client/src/leap/soledad/client/http_target/__init__.py b/client/src/leap/soledad/client/http_target/__init__.py
index 7a5cea9f..498fb6e7 100644
--- a/client/src/leap/soledad/client/http_target/__init__.py
+++ b/client/src/leap/soledad/client/http_target/__init__.py
@@ -87,4 +87,8 @@ class SoledadHTTPSyncTarget(SyncTargetAPI, HTTPDocSender, HTTPDocFetcher):
# asynchronous encryption/decryption attributes
self._decryption_callback = None
self._sync_decr_pool = None
- self._http = HTTPClient(cert_file)
+
+ # XXX Increasing timeout of simple requests to avoid chances of hitting
+ # the duplicated syncing bug. This could be reduced to the 30s default
+ # after implementing Cancellable Sync. See #7382
+ self._http = HTTPClient(cert_file, timeout=90)
diff --git a/client/src/leap/soledad/client/sync.py b/client/src/leap/soledad/client/sync.py
index 110baa0a..2276db2a 100644
--- a/client/src/leap/soledad/client/sync.py
+++ b/client/src/leap/soledad/client/sync.py
@@ -22,6 +22,7 @@ import logging
from twisted.internet import defer
from u1db import errors
+from leap.soledad.common.errors import MissingDesignDocError
from u1db.sync import Synchronizer
@@ -69,9 +70,16 @@ class SoledadSynchronizer(Synchronizer):
# get target identifier, its current generation,
# and its last-seen database generation for this source
ensure_callback = None
- (self.target_replica_uid, target_gen, target_trans_id,
- target_my_gen, target_my_trans_id) = yield \
- sync_target.get_sync_info(self.source._replica_uid)
+ try:
+ (self.target_replica_uid, target_gen, target_trans_id,
+ target_my_gen, target_my_trans_id) = yield \
+ sync_target.get_sync_info(self.source._replica_uid)
+ except (errors.DatabaseDoesNotExist, MissingDesignDocError) as e:
+ logger.debug("Database isn't ready on server. Will be created.")
+ logger.debug("Reason: %s", e.__class__)
+ self.target_replica_uid = None
+ target_gen, target_trans_id = 0, ''
+ target_my_gen, target_my_trans_id = 0, ''
logger.debug(
"Soledad target sync info:\n"