summary refs log tree commit diff
path: root/synapse/event_auth.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-03-01 17:33:04 +0000
committerErik Johnston <erik@matrix.org>2023-03-01 17:33:04 +0000
commit2ab39ac4976b7e063a659b300ede24add5e1dce3 (patch)
treeb95aee67bf4b7188fc1e72352461bc5e124f993a /synapse/event_auth.py
parentRemove support for aggregating reactions (#15172) (diff)
downloadsynapse-github/erikj/fixes_batch.tar.xz
Diffstat (limited to 'synapse/event_auth.py')
-rw-r--r--synapse/event_auth.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/synapse/event_auth.py b/synapse/event_auth.py

index 4d6d1b8ebd..813ef00ceb 100644 --- a/synapse/event_auth.py +++ b/synapse/event_auth.py
@@ -168,13 +168,21 @@ async def check_state_independent_auth_rules( return # 2. Reject if event has auth_events that: ... - auth_events = await store.get_events( - event.auth_event_ids(), - redact_behaviour=EventRedactBehaviour.as_is, - allow_rejected=True, - ) if batched_auth_events: - auth_events.update(batched_auth_events) + auth_event_ids = event.auth_event_ids() + auth_events = dict(batched_auth_events) + if set(auth_event_ids) - batched_auth_events.keys(): + auth_events.update( + await store.get_events( + set(auth_event_ids) - batched_auth_events.keys() + ) + ) + else: + auth_events = await store.get_events( + event.auth_event_ids(), + redact_behaviour=EventRedactBehaviour.as_is, + allow_rejected=True, + ) room_id = event.room_id auth_dict: MutableStateMap[str] = {}