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

Commit

Permalink
Use servers list approx to send read receipts when in partial state (#…
Browse files Browse the repository at this point in the history
…14549)


Signed-off-by: Mathieu Velten <[email protected]>
  • Loading branch information
Mathieu Velten authored and H-Shay committed Dec 13, 2022
1 parent aa389ed commit 5d1d21b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/14549.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faster joins: use servers list approximation to send read receipts when in partial state instead of waiting for the full state of the room.
2 changes: 1 addition & 1 deletion synapse/federation/sender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ async def send_read_receipt(self, receipt: ReadReceipt) -> None:
room_id = receipt.room_id

# Work out which remote servers should be poked and poke them.
domains_set = await self._storage_controllers.state.get_current_hosts_in_room(
domains_set = await self._storage_controllers.state.get_current_hosts_in_room_or_partial_state_approximation(
room_id
)
domains = [
Expand Down
4 changes: 4 additions & 0 deletions tests/federation/test_federation_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def make_homeserver(self, reactor, clock):
return_value=make_awaitable({"test", "host2"})
)

hs.get_storage_controllers().state.get_current_hosts_in_room_or_partial_state_approximation = (
hs.get_storage_controllers().state.get_current_hosts_in_room
)

return hs

@override_config({"send_federation": True})
Expand Down

0 comments on commit 5d1d21b

Please sign in to comment.