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

Commit

Permalink
Ensure that event.redacts is the proper type before handling it (#8457)
Browse files Browse the repository at this point in the history
This fixes a bug when backfilling invalid events.
  • Loading branch information
clokep committed Oct 5, 2020
1 parent 0991a2d commit da11cc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/8457.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug where backfilling a room with an event that was missing the `redacts` field would break.
2 changes: 2 additions & 0 deletions synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ def check_redaction(

if room_version_obj.event_format == EventFormatVersions.V1:
redacter_domain = get_domain_from_id(event.event_id)
if not isinstance(event.redacts, str):
return False
redactee_domain = get_domain_from_id(event.redacts)
if redacter_domain == redactee_domain:
return True
Expand Down

0 comments on commit da11cc2

Please sign in to comment.