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

Commit

Permalink
typing: remove redundant check leading to being stuck on fast join
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
  • Loading branch information
Mathieu Velten committed Sep 22, 2022
1 parent 1a1abdd commit fde02a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog.d/13830.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faster room joins: fix typing EDU being stuck because the handler was waiting for the full state in a redundant check.
15 changes: 5 additions & 10 deletions synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,11 @@ async def _recv_edu(self, origin: str, content: JsonDict) -> None:
)
return

domains = await self._storage_controllers.state.get_current_hosts_in_room(
room_id
)

if self.server_name in domains:
logger.info("Got typing update from %s: %r", user_id, content)
now = self.clock.time_msec()
self._member_typing_until[member] = now + FEDERATION_TIMEOUT
self.wheel_timer.insert(now=now, obj=member, then=now + FEDERATION_TIMEOUT)
self._push_update_local(member=member, typing=content["typing"])
logger.info("Got typing update from %s: %r", user_id, content)
now = self.clock.time_msec()
self._member_typing_until[member] = now + FEDERATION_TIMEOUT
self.wheel_timer.insert(now=now, obj=member, then=now + FEDERATION_TIMEOUT)
self._push_update_local(member=member, typing=content["typing"])

def _push_update_local(self, member: RoomMember, typing: bool) -> None:
room_set = self._room_typing.setdefault(member.room_id, set())
Expand Down

0 comments on commit fde02a7

Please sign in to comment.