Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'erikj/faster_typing' of github.com:matrix-org/synapse i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
erikjohnston committed Jul 15, 2020
2 parents 8c7d0f1 + 9006e12 commit 97e1159
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/7856.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Small performance improvement in typing processing.
4 changes: 2 additions & 2 deletions synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _push_update(self, member, typing):

async def _push_remote(self, member, typing):
try:
users = await self.state.get_current_users_in_room(member.room_id)
users = await self.store.get_users_in_room(member.room_id)
self._member_last_federation_poke[member] = self.clock.time_msec()

now = self.clock.time_msec()
Expand Down Expand Up @@ -224,7 +224,7 @@ async def _recv_edu(self, origin, content):
)
return

users = await self.state.get_current_users_in_room(room_id)
users = await self.store.get_users_in_room(room_id)
domains = {get_domain_from_id(u) for u in users}

if self.server_name in domains:
Expand Down
4 changes: 2 additions & 2 deletions tests/handlers/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ def get_joined_hosts_for_room(room_id):

self.datastore.get_joined_hosts_for_room = get_joined_hosts_for_room

def get_current_users_in_room(room_id):
def get_users_in_room(room_id):
return defer.succeed({str(u) for u in self.room_members})

hs.get_state_handler().get_current_users_in_room = get_current_users_in_room
self.datastore.get_users_in_room = get_users_in_room

self.datastore.get_user_directory_stream_pos.return_value = (
# we deliberately return a non-None stream pos to avoid doing an initial_spam
Expand Down

0 comments on commit 97e1159

Please sign in to comment.