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

Commit

Permalink
Stop tracking events unnecessarily.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jun 11, 2021
1 parent 3357a6a commit 8103061
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions synapse/handlers/space_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ async def get_space_summary(
# rooms we have already processed
processed_rooms = set() # type: Set[str]

# events we have already processed. We don't necessarily have their event ids,
# so instead we key on (room id, state key)
processed_events = set() # type: Set[Tuple[str, str]]

rooms_result = [] # type: List[JsonDict]
events_result = [] # type: List[JsonDict]

Expand Down Expand Up @@ -206,21 +202,13 @@ async def get_space_summary(
# a remote server, whether or not they actually link to any rooms in our
# tree?
for ev in events:
# remote servers might return events we have already processed
# (eg, Dendrite returns inward pointers as well as outward ones), so
# we need to filter them out, to avoid returning duplicate links to the
# client.
ev_key = (ev["room_id"], ev["state_key"])
if ev_key in processed_events:
continue
events_result.append(ev)

# add the child to the queue. we have already validated
# that the vias are a list of server names.
room_queue.append(
_RoomQueueEntry(ev["state_key"], ev["content"]["via"])
)
processed_events.add(ev_key)

# Before returning to the client, remove the allowed_spaces key for any
# rooms.
Expand Down

0 comments on commit 8103061

Please sign in to comment.