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

Commit

Permalink
Fix get_metadata_for_events (#12904)
Browse files Browse the repository at this point in the history
This method was introduced in #12852. It is using the `state_key` column from
the `events` table, which is not (yet) reliable (see #11496).
  • Loading branch information
richvdh authored May 30, 2022
1 parent 1199387 commit 2480461
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/12904.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pull out less state when handling gaps in room DAG.
4 changes: 2 additions & 2 deletions synapse/storage/databases/main/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def get_metadata_for_events_txn(
)

sql = f"""
SELECT e.event_id, e.room_id, e.type, e.state_key FROM events AS e
LEFT JOIN state_events USING (event_id)
SELECT e.event_id, e.room_id, e.type, se.state_key FROM events AS e
LEFT JOIN state_events se USING (event_id)
WHERE {clause}
"""

Expand Down

0 comments on commit 2480461

Please sign in to comment.