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

Use servers list approx to send read receipts when in partial state #14549

Merged
merged 3 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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