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

Fix 'rejected_events_metadata' background update #9537

Merged
merged 2 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9537.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix rare edge case that caused a background update to fail if the server had rejected an event that had duplicate auth events.
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/events_bg_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,9 @@ def get_rejected_events(
)

if not has_event_auth:
for auth_id in event.auth_event_ids():
# Old, dodgy, events may have duplicate auth events, which we
# need to deduplicate as we have a unique constraint.
for auth_id in set(event.auth_event_ids()):
auth_events.append(
{
"room_id": event.room_id,
Expand Down