mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 13:44:57 -04:00
Do not include rooms with an unknown room version in a sync response. (#10644)
A user will still see this room if it is in a local cache, but it will not reappear if clearing the cache and reloading.
This commit is contained in:
parent
b5fef6054a
commit
000aa89be6
7 changed files with 145 additions and 11 deletions
|
@ -386,9 +386,10 @@ class RoomMemberWorkerStore(EventsWorkerStore):
|
|||
)
|
||||
|
||||
sql = """
|
||||
SELECT room_id, e.sender, c.membership, event_id, e.stream_ordering
|
||||
SELECT room_id, e.sender, c.membership, event_id, e.stream_ordering, r.room_version
|
||||
FROM local_current_membership AS c
|
||||
INNER JOIN events AS e USING (room_id, event_id)
|
||||
INNER JOIN rooms AS r USING (room_id)
|
||||
WHERE
|
||||
user_id = ?
|
||||
AND %s
|
||||
|
@ -397,7 +398,7 @@ class RoomMemberWorkerStore(EventsWorkerStore):
|
|||
)
|
||||
|
||||
txn.execute(sql, (user_id, *args))
|
||||
results = [RoomsForUser(**r) for r in self.db_pool.cursor_to_dict(txn)]
|
||||
results = [RoomsForUser(*r) for r in txn]
|
||||
|
||||
return results
|
||||
|
||||
|
@ -447,7 +448,8 @@ class RoomMemberWorkerStore(EventsWorkerStore):
|
|||
|
||||
Returns:
|
||||
Returns the rooms the user is in currently, along with the stream
|
||||
ordering of the most recent join for that user and room.
|
||||
ordering of the most recent join for that user and room, along with
|
||||
the room version of the room.
|
||||
"""
|
||||
return await self.db_pool.runInteraction(
|
||||
"get_rooms_for_user_with_stream_ordering",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue