summary refs log tree commit diff
path: root/synapse/handlers/federation_event.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-09-22 17:58:57 +0100
committerGitHub <noreply@github.com>2021-09-22 17:58:57 +0100
commit26f2bfedbf5493d8a69d1b38147b6236e7606cd3 (patch)
tree7e1886447a6293f0c5f6ac92778891b93df1d3b2 /synapse/handlers/federation_event.py
parentTreat "\u0000" as "\u0020" for the purposes of message search (message indexi... (diff)
downloadsynapse-26f2bfedbf5493d8a69d1b38147b6236e7606cd3.tar.xz
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.
Diffstat (limited to 'synapse/handlers/federation_event.py')
-rw-r--r--synapse/handlers/federation_event.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/synapse/handlers/federation_event.py b/synapse/handlers/federation_event.py
index 3b95beeb08..10b3fdc222 100644
--- a/synapse/handlers/federation_event.py
+++ b/synapse/handlers/federation_event.py
@@ -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,