Factor out a separate EventContext.for_outlier (#10883)

Constructing an EventContext for an outlier is actually really simple, and
there's no sense in going via an `async` method in the `StateHandler`.

This also means that we can resolve a bunch of FIXMEs.
This commit is contained in:
Richard van der Hoff 2021-09-22 17:58:57 +01:00 committed by GitHub
parent f78b68a96b
commit 26f2bfedbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 44 deletions

View file

@ -1221,7 +1221,7 @@ class FederationEventHandler:
async def prep(ev_info: _NewEventInfo) -> EventContext:
event = ev_info.event
with nested_logging_context(suffix=event.event_id):
res = await self._state_handler.compute_event_context(event)
res = EventContext.for_outlier()
res = await self._check_event_auth(
origin,
event,
@ -1540,10 +1540,7 @@ class FederationEventHandler:
event.event_id,
auth_event.event_id,
)
missing_auth_event_context = (
await self._state_handler.compute_event_context(auth_event)
)
missing_auth_event_context = EventContext.for_outlier()
missing_auth_event_context = await self._check_event_auth(
origin,
auth_event,