mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-28 05:45:20 -04:00
Send device list updates out to servers in partially joined rooms (#13874)
Use the provided list of servers in the room from the `/send_join` response, since we will not know which users are in the room. This isn't sufficient to ensure that all remote servers receive the right device list updates, since the `/send_join` response may be inaccurate or we may calculate the membership state of new users in the room incorrectly. Signed-off-by: Sean Quah <seanq@matrix.org>
This commit is contained in:
parent
c06b2b7142
commit
03c2bfb7f8
4 changed files with 66 additions and 2 deletions
|
@ -25,6 +25,7 @@ from typing import (
|
|||
List,
|
||||
Mapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
Tuple,
|
||||
Union,
|
||||
cast,
|
||||
|
@ -1133,6 +1134,22 @@ class RoomWorkerStore(CacheInvalidationWorkerStore):
|
|||
get_rooms_for_retention_period_in_range_txn,
|
||||
)
|
||||
|
||||
async def get_partial_state_servers_at_join(self, room_id: str) -> Sequence[str]:
|
||||
"""Gets the list of servers in a partial state room at the time we joined it.
|
||||
|
||||
Returns:
|
||||
The `servers_in_room` list from the `/send_join` response for partial state
|
||||
rooms. May not be accurate or complete, as it comes from a remote
|
||||
homeserver.
|
||||
An empty list for full state rooms.
|
||||
"""
|
||||
return await self.db_pool.simple_select_onecol(
|
||||
"partial_state_rooms_servers",
|
||||
keyvalues={"room_id": room_id},
|
||||
retcol="server_name",
|
||||
desc="get_partial_state_servers_at_join",
|
||||
)
|
||||
|
||||
async def get_partial_state_rooms_and_servers(
|
||||
self,
|
||||
) -> Mapping[str, Collection[str]]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue