@@ -1116,22 +1116,19 @@ async def get_event(event_id: str) -> None:
1116
1116
1117
1117
await concurrently_execute (get_event , event_ids , 5 )
1118
1118
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 )
1120
1120
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 ]
1123
1123
) -> 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.
1127
1125
1128
1126
We first sort the events to make sure that we process each event's auth_events
1129
1127
before the event itself, and then auth and persist them.
1130
1128
1131
1129
Notifies about the events where appropriate.
1132
1130
1133
1131
Params:
1134
- origin: where the events came from
1135
1132
room_id: the room that the events are meant to be in (though this has
1136
1133
not yet been checked)
1137
1134
events: the events that have been fetched
@@ -1167,15 +1164,15 @@ async def _auth_and_persist_fetched_events(
1167
1164
shortstr (e .event_id for e in roots ),
1168
1165
)
1169
1166
1170
- await self ._auth_and_persist_fetched_events_inner ( origin , room_id , roots )
1167
+ await self ._auth_and_persist_outliers_inner ( room_id , roots )
1171
1168
1172
1169
for ev in roots :
1173
1170
del event_map [ev .event_id ]
1174
1171
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 ]
1177
1174
) -> None :
1178
- """Helper for _auth_and_persist_fetched_events
1175
+ """Helper for _auth_and_persist_outliers
1179
1176
1180
1177
Persists a batch of events where we have (theoretically) already persisted all
1181
1178
of their auth events.
@@ -1719,9 +1716,7 @@ async def _get_remote_auth_chain_for_event(
1719
1716
for s in seen_remotes :
1720
1717
remote_event_map .pop (s , None )
1721
1718
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 ())
1725
1720
1726
1721
async def _update_context_for_auth_events (
1727
1722
self , event : EventBase , context : EventContext , auth_events : StateMap [EventBase ]
0 commit comments