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

Commit da11cc2

Browse files
authored
Ensure that event.redacts is the proper type before handling it (#8457)
This fixes a bug when backfilling invalid events.
1 parent 0991a2d commit da11cc2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changelog.d/8457.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug where backfilling a room with an event that was missing the `redacts` field would break.

synapse/event_auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ def check_redaction(
446446

447447
if room_version_obj.event_format == EventFormatVersions.V1:
448448
redacter_domain = get_domain_from_id(event.event_id)
449+
if not isinstance(event.redacts, str):
450+
return False
449451
redactee_domain = get_domain_from_id(event.redacts)
450452
if redacter_domain == redactee_domain:
451453
return True

0 commit comments

Comments
 (0)