diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-09-12 11:14:56 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-09-12 11:14:56 +0100 |
commit | 4a32d25d4c97b10f74e636d46b312ba6b660987b (patch) | |
tree | 53c35423e6469adc87cc5b213d5b960fd143277c /synapse/replication/resource.py | |
parent | Fix unit tests (diff) | |
parent | Merge pull request #1102 from matrix-org/revert-1099-dbkr/make_notif_highligh... (diff) | |
download | synapse-4a32d25d4c97b10f74e636d46b312ba6b660987b.tar.xz |
Merge branch 'develop' into markjh/bearer_token
Diffstat (limited to 'synapse/replication/resource.py')
-rw-r--r-- | synapse/replication/resource.py | 9 |
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 ) |