Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Don't add previously rejected events to state during state res
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Quah <seanq@matrix.org>
  • Loading branch information
Sean Quah committed Sep 6, 2022
1 parent 751ade9 commit 8c68d80
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions synapse/state/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,16 @@ async def _iterative_auth_checks(
if ev.rejected_reason is None:
auth_events[key] = event_map[ev_id]

try:
event_auth.check_state_dependent_auth_rules(
event,
auth_events.values(),
)
if event.rejected_reason is None:
try:
event_auth.check_state_dependent_auth_rules(
event,
auth_events.values(),
)

resolved_state[(event.type, event.state_key)] = event_id
except AuthError:
pass
resolved_state[(event.type, event.state_key)] = event_id
except AuthError:
pass

# We await occasionally when we're working with large data sets to
# ensure that we don't block the reactor loop for too long.
Expand Down

0 comments on commit 8c68d80

Please sign in to comment.