diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2022-03-21 11:23:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-21 11:23:32 +0000 |
commit | afa17f0eabf06087d53697eafc748f7c935fb13f (patch) | |
tree | 7e8917ce179c871e3efd41a086aa1ca75cdcd5c3 /synapse/federation | |
parent | Try to detect borked package installations. (#12244) (diff) | |
download | synapse-afa17f0eabf06087d53697eafc748f7c935fb13f.tar.xz |
Return a 404 from `/state` for an outlier (#12087)
* Replace `get_state_for_pdu` with `get_state_ids_for_pdu` and `get_events_as_list`. * Return a 404 from `/state` and `/state_ids` for an outlier
Diffstat (limited to 'synapse/federation')
-rw-r--r-- | synapse/federation/federation_server.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index 482bbdd867..af2d0f7d79 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -22,7 +22,6 @@ from typing import ( Callable, Collection, Dict, - Iterable, List, Optional, Tuple, @@ -577,10 +576,10 @@ class FederationServer(FederationBase): async def _on_context_state_request_compute( self, room_id: str, event_id: Optional[str] ) -> Dict[str, list]: + pdus: Collection[EventBase] if event_id: - pdus: Iterable[EventBase] = await self.handler.get_state_for_pdu( - room_id, event_id - ) + event_ids = await self.handler.get_state_ids_for_pdu(room_id, event_id) + pdus = await self.store.get_events_as_list(event_ids) else: pdus = (await self.state.get_current_state(room_id)).values() |