Skip to content
Snippets Groups Projects
Unverified Commit a4fa044c authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Fix 'rejected_events_metadata' background update (#9537)

Turns out matrix.org has an event that has duplicate auth events (which really isn't supposed to happen, but here we are). This caused the background update to fail due to `UniqueViolation`.
parent 922788c6
No related branches found
No related tags found
No related merge requests found
Fix rare edge case that caused a background update to fail if the server had rejected an event that had duplicate auth events.
...@@ -696,7 +696,9 @@ class EventsBackgroundUpdatesStore(SQLBaseStore): ...@@ -696,7 +696,9 @@ class EventsBackgroundUpdatesStore(SQLBaseStore):
) )
if not has_event_auth: 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( auth_events.append(
{ {
"room_id": event.room_id, "room_id": event.room_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment