diff options
author | Erik Johnston <erik@matrix.org> | 2022-09-28 23:22:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-28 23:22:35 +0100 |
commit | 5f659d4a88e602ca8519984808dcf4df036c781b (patch) | |
tree | 56d5a9f13998c6590a4e16db139a58964ff171f7 /synapse/storage/databases/main/room.py | |
parent | Limit and filter the number of backfill points to get from the database (#13879) (diff) | |
download | synapse-5f659d4a88e602ca8519984808dcf4df036c781b.tar.xz |
Handle local device list updates during partial join (#13934)
Diffstat (limited to 'synapse/storage/databases/main/room.py')
-rw-r--r-- | synapse/storage/databases/main/room.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/room.py b/synapse/storage/databases/main/room.py index 672c9a03fc..059eef5c22 100644 --- a/synapse/storage/databases/main/room.py +++ b/synapse/storage/databases/main/room.py @@ -1256,6 +1256,22 @@ class RoomWorkerStore(CacheInvalidationWorkerStore): return entry is not None + async def get_join_event_id_and_device_lists_stream_id_for_partial_state( + self, room_id: str + ) -> Tuple[str, int]: + """Get the event ID of the initial join that started the partial + join, and the device list stream ID at the point we started the partial + join. + """ + + result = await self.db_pool.simple_select_one( + table="partial_state_rooms", + keyvalues={"room_id": room_id}, + retcols=("join_event_id", "device_lists_stream_id"), + desc="get_join_event_id_for_partial_state", + ) + return result["join_event_id"], result["device_lists_stream_id"] + class _BackgroundUpdates: REMOVE_TOMESTONED_ROOMS_BG_UPDATE = "remove_tombstoned_rooms_from_directory" |