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

Commit

Permalink
Clarify comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Apr 27, 2022
1 parent bd886bb commit 4f7132c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions synapse/handlers/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,18 @@ async def get_bundled_aggregations(
latest_thread_event = thread.latest_event
if latest_thread_event and latest_thread_event.event_id not in events_by_id:
events_by_id[latest_thread_event.event_id] = latest_thread_event
# The latest event in the thread must have a thread relation.
# Keep relations_by_id in sync with events_by_id:
#
# We know that the latest event in a thread has a thread relation
# (as that is what makes it part of the thread).
relations_by_id[latest_thread_event.event_id] = RelationTypes.THREAD

# Fetch other relations per event.
for event in events_by_id.values():
# Edits and annotations may not have related annotations or references.
# An event which is a replacement (ie edit) or annotation (ie, reaction)
# may not have any other event related to it.
#
# XXX This is buggy, see https://github.com/matrix-org/synapse/issues/12566
if relations_by_id.get(event.event_id) in (
RelationTypes.ANNOTATION,
RelationTypes.REPLACE,
Expand Down

0 comments on commit 4f7132c

Please sign in to comment.