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

Prevent message search in upgraded rooms we're not in #6385

Merged
merged 11 commits into from
Dec 11, 2019
8 changes: 6 additions & 2 deletions synapse/handlers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ def get_old_rooms_from_upgraded_room(self, room_id):
while True:
try:
predecessor = yield self.store.get_room_predecessor(room_id)
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
predecessor_room_id = predecessor["room_id"]
if not predecessor:
# This room does not have a predecessor
break
except NotFoundError:
# This room does not have a predecessor
# Unknown room_id
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
break

predecessor_room_id = predecessor["room_id"]
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

# Add predecessor's room ID
historical_room_ids.append(predecessor_room_id)
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved

Expand Down