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

Commit

Permalink
Exclude rejected state events when calculating state at backwards ext…
Browse files Browse the repository at this point in the history
…rems (#6527)

This fixes a weird bug where, if you were determined enough, you could end up with a rejected event forming part of the state at a backwards-extremity. Authing that backwards extrem would then lead to us trying to pull the rejected event from the db (with allow_rejected=False), which would fail with a 404.
  • Loading branch information
richvdh committed Dec 16, 2019
1 parent ff773ff commit bbb75ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/6527.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug which could cause the federation server to incorrectly return errors when handling certain obscure event graphs.
2 changes: 1 addition & 1 deletion synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def _get_state_for_room(
remote_event = event_map.get(event_id)
if not remote_event:
raise Exception("Unable to get missing prev_event %s" % (event_id,))
if remote_event.is_state():
if remote_event.is_state() and remote_event.rejected_reason is None:
remote_state.append(remote_event)

auth_chain = [event_map[e_id] for e_id in auth_event_ids if e_id in event_map]
Expand Down

0 comments on commit bbb75ff

Please sign in to comment.