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

Commit

Permalink
Fix 500 error with Postgres when looking backwards with the MSC3030 `…
Browse files Browse the repository at this point in the history
…/timestamp_to_event` endpoint (#12024)
  • Loading branch information
MadLittleMods authored Feb 18, 2022
1 parent 40e256e commit 5a69115
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/12024.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix 500 error with Postgres when looking backwards with the [MSC3030](https://github.com/matrix-org/matrix-doc/pull/3030) `/timestamp_to_event?dir=b` endpoint.
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/events_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,7 @@ def is_event_next_to_gap_txn(txn: LoggingTransaction) -> bool:
forward_edge_query = """
SELECT 1 FROM event_edges
/* Check to make sure the event referencing our event in question is not rejected */
LEFT JOIN rejections ON event_edges.event_id == rejections.event_id
LEFT JOIN rejections ON event_edges.event_id = rejections.event_id
WHERE
event_edges.room_id = ?
AND event_edges.prev_event_id = ?
Expand Down

0 comments on commit 5a69115

Please sign in to comment.