summary refs log tree commit diff
path: root/synapse/replication/resource.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-12 12:37:09 +0100
committerErik Johnston <erik@matrix.org>2016-09-12 12:37:09 +0100
commit7fe42cf9492273c68a4fede9c697c0c2fb6d020b (patch)
tree44d1b5bd52c26dfb9e8e0389b6bebe0e2d861ed3 /synapse/replication/resource.py
parentMake reindex happen in bg (diff)
parentMerge pull request #1103 from matrix-org/markjh/comment_on_create_index (diff)
downloadsynapse-7fe42cf9492273c68a4fede9c697c0c2fb6d020b.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/make_notif_highlight_query_fast
Diffstat (limited to 'synapse/replication/resource.py')
-rw-r--r--synapse/replication/resource.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/replication/resource.py b/synapse/replication/resource.py
index 857bc9795c..299e9419a4 100644
--- a/synapse/replication/resource.py
+++ b/synapse/replication/resource.py
@@ -274,11 +274,18 @@ class ReplicationResource(Resource):
 
     @defer.inlineCallbacks
     def typing(self, writer, current_token, request_streams):
-        current_position = current_token.presence
+        current_position = current_token.typing
 
         request_typing = request_streams.get("typing")
 
         if request_typing is not None:
+            # If they have a higher token than current max, we can assume that
+            # they had been talking to a previous instance of the master. Since
+            # we reset the token on restart, the best (but hacky) thing we can
+            # do is to simply resend down all the typing notifications.
+            if request_typing > current_position:
+                request_typing = 0
+
             typing_rows = yield self.typing_handler.get_all_typing_updates(
                 request_typing, current_position
             )