@@ -1116,22 +1116,19 @@ async def get_event(event_id: str) -> None:
11161116
11171117 await concurrently_execute (get_event , event_ids , 5 )
11181118 logger .info ("Fetched %i events of %i requested" , len (events ), len (event_ids ))
1119- await self ._auth_and_persist_fetched_events ( destination , room_id , events )
1119+ await self ._auth_and_persist_outliers ( room_id , events )
11201120
1121- async def _auth_and_persist_fetched_events (
1122- self , origin : str , room_id : str , events : Iterable [EventBase ]
1121+ async def _auth_and_persist_outliers (
1122+ self , room_id : str , events : Iterable [EventBase ]
11231123 ) -> None :
1124- """Persist the events fetched by _get_events_and_persist or _get_remote_auth_chain_for_event
1125-
1126- The events to be persisted must be outliers.
1124+ """Persist a batch of outlier events fetched from remote servers.
11271125
11281126 We first sort the events to make sure that we process each event's auth_events
11291127 before the event itself, and then auth and persist them.
11301128
11311129 Notifies about the events where appropriate.
11321130
11331131 Params:
1134- origin: where the events came from
11351132 room_id: the room that the events are meant to be in (though this has
11361133 not yet been checked)
11371134 events: the events that have been fetched
@@ -1167,15 +1164,15 @@ async def _auth_and_persist_fetched_events(
11671164 shortstr (e .event_id for e in roots ),
11681165 )
11691166
1170- await self ._auth_and_persist_fetched_events_inner ( origin , room_id , roots )
1167+ await self ._auth_and_persist_outliers_inner ( room_id , roots )
11711168
11721169 for ev in roots :
11731170 del event_map [ev .event_id ]
11741171
1175- async def _auth_and_persist_fetched_events_inner (
1176- self , origin : str , room_id : str , fetched_events : Collection [EventBase ]
1172+ async def _auth_and_persist_outliers_inner (
1173+ self , room_id : str , fetched_events : Collection [EventBase ]
11771174 ) -> None :
1178- """Helper for _auth_and_persist_fetched_events
1175+ """Helper for _auth_and_persist_outliers
11791176
11801177 Persists a batch of events where we have (theoretically) already persisted all
11811178 of their auth events.
@@ -1719,9 +1716,7 @@ async def _get_remote_auth_chain_for_event(
17191716 for s in seen_remotes :
17201717 remote_event_map .pop (s , None )
17211718
1722- await self ._auth_and_persist_fetched_events (
1723- destination , room_id , remote_event_map .values ()
1724- )
1719+ await self ._auth_and_persist_outliers (room_id , remote_event_map .values ())
17251720
17261721 async def _update_context_for_auth_events (
17271722 self , event : EventBase , context : EventContext , auth_events : StateMap [EventBase ]
0 commit comments