summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-10-11 16:08:56 +0100
committerErik Johnston <erik@matrix.org>2017-10-11 16:08:56 +0100
commit33f541583b8e0fa6bf0bf8957e67d4102a24598f (patch)
tree719e1edaf52cb0e75366b6a1b5aa682440611fab
parentMerge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes (diff)
parentMerge pull request #2533 from matrix-org/erikj/fix_group_repl (diff)
downloadsynapse-33f541583b8e0fa6bf0bf8957e67d4102a24598f.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
-rw-r--r--synapse/federation/transport/client.py2
-rw-r--r--synapse/handlers/receipts.py4
-rw-r--r--synapse/storage/group_server.py14
3 files changed, 12 insertions, 8 deletions
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py
index 36f6eb75e9..f96561c1fe 100644
--- a/synapse/federation/transport/client.py
+++ b/synapse/federation/transport/client.py
@@ -572,7 +572,7 @@ class TransportLayerClient(object):
         return self.client.post_json(
             destination=destination,
             path=path,
-            args=requester_user_id,
+            args={"requester_user_id": requester_user_id},
             data=content,
             ignore_backoff=True,
         )
diff --git a/synapse/handlers/receipts.py b/synapse/handlers/receipts.py
index e1cd3a48e9..0525765272 100644
--- a/synapse/handlers/receipts.py
+++ b/synapse/handlers/receipts.py
@@ -12,6 +12,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+from synapse.util import logcontext
 
 from ._base import BaseHandler
 
@@ -59,6 +60,8 @@ class ReceiptsHandler(BaseHandler):
         is_new = yield self._handle_new_receipts([receipt])
 
         if is_new:
+            # fire off a process in the background to send the receipt to
+            # remote servers
             self._push_remotes([receipt])
 
     @defer.inlineCallbacks
@@ -126,6 +129,7 @@ class ReceiptsHandler(BaseHandler):
 
             defer.returnValue(True)
 
+    @logcontext.preserve_fn   # caller should not yield on this
     @defer.inlineCallbacks
     def _push_remotes(self, receipts):
         """Given a list of receipts, works out which remote servers should be
diff --git a/synapse/storage/group_server.py b/synapse/storage/group_server.py
index 4fe9172adc..3af372de59 100644
--- a/synapse/storage/group_server.py
+++ b/synapse/storage/group_server.py
@@ -1172,13 +1172,13 @@ class GroupServerStore(SQLBaseStore):
                 LIMIT ?
             """
             txn.execute(sql, (from_token, to_token, limit,))
-            return [{
-                "stream_id": stream_id,
-                "group_id": group_id,
-                "user_id": user_id,
-                "type": gtype,
-                "content": json.loads(content_json),
-            } for stream_id, group_id, user_id, gtype, content_json in txn]
+            return [(
+                stream_id,
+                group_id,
+                user_id,
+                gtype,
+                json.loads(content_json),
+            ) for stream_id, group_id, user_id, gtype, content_json in txn]
         return self.runInteraction(
             "get_all_groups_changes", _get_all_groups_changes_txn,
         )