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

Commit 2480461

Browse files
authored
Fix get_metadata_for_events (#12904)
This method was introduced in #12852. It is using the `state_key` column from the `events` table, which is not (yet) reliable (see #11496).
1 parent 1199387 commit 2480461

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog.d/12904.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pull out less state when handling gaps in room DAG.

synapse/storage/databases/main/state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ def get_metadata_for_events_txn(
167167
)
168168

169169
sql = f"""
170-
SELECT e.event_id, e.room_id, e.type, e.state_key FROM events AS e
171-
LEFT JOIN state_events USING (event_id)
170+
SELECT e.event_id, e.room_id, e.type, se.state_key FROM events AS e
171+
LEFT JOIN state_events se USING (event_id)
172172
WHERE {clause}
173173
"""
174174

0 commit comments

Comments
 (0)