mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-20 19:53:58 +01:00
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`.
This commit is contained in:
parent
922788c604
commit
a4fa044c00
2 changed files with 4 additions and 1 deletions
1
changelog.d/9537.bugfix
Normal file
1
changelog.d/9537.bugfix
Normal file
|
@ -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.
|
|
@ -696,7 +696,9 @@ class EventsBackgroundUpdatesStore(SQLBaseStore):
|
|||
)
|
||||
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue