From ef4716763a5d3365ac1acae4c9290e4d785cf689 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 18 Jun 2024 16:02:58 +0100 Subject: [PATCH] Comments --- synapse/storage/databases/main/events.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/synapse/storage/databases/main/events.py b/synapse/storage/databases/main/events.py index 0ece4b1b409..014cf596277 100644 --- a/synapse/storage/databases/main/events.py +++ b/synapse/storage/databases/main/events.py @@ -101,6 +101,15 @@ def is_noop(self) -> bool: @attr.s(slots=True, auto_attribs=True) class NewEventChainLinks: + """Information about new auth chain links that need to be added to the DB. + + Attributes: + chain_id, sequence_number: the IDs corresponding to the event being + inserted, and the starting point of the links + links: Lists the links that need to be added, 2-tuple of the chain + ID/sequence number of the end point of the link. + """ + chain_id: int sequence_number: int @@ -661,6 +670,10 @@ def _calculate_chain_cover_index( event_to_types: Event ID to type and state_key of the event event_to_auth_chain: Event ID to list of auth event IDs of the event (events with no auth events can be excluded). + + Returns: + A mapping with any new auth chain links we need to add, keyed by + event ID. """ # Map from event ID to chain ID/sequence number.