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

Commit 4f7132c

Browse files
committed
Clarify comment.
1 parent bd886bb commit 4f7132c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

synapse/handlers/relations.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,18 @@ async def get_bundled_aggregations(
405405
latest_thread_event = thread.latest_event
406406
if latest_thread_event and latest_thread_event.event_id not in events_by_id:
407407
events_by_id[latest_thread_event.event_id] = latest_thread_event
408-
# The latest event in the thread must have a thread relation.
408+
# Keep relations_by_id in sync with events_by_id:
409+
#
410+
# We know that the latest event in a thread has a thread relation
411+
# (as that is what makes it part of the thread).
409412
relations_by_id[latest_thread_event.event_id] = RelationTypes.THREAD
410413

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

0 commit comments

Comments
 (0)