From 1386ce4735019ea6e918591509ee58a82c9c635c Mon Sep 17 00:00:00 2001
From: Patrick Cloke <clokep@users.noreply.github.com>
Date: Wed, 28 Sep 2022 11:01:41 -0400
Subject: [PATCH] Revert "Stop returning an unused column when handling new
 receipts. (#13933)" (#13935)

This reverts commit 7766bd5b354cd4ea1a33351ba320e54a14d3aeac (#13933).

The unused column is actually used, but much further down in the function.
---
 changelog.d/13933.feature                            | 1 -
 synapse/storage/databases/main/event_push_actions.py | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
 delete mode 100644 changelog.d/13933.feature

diff --git a/changelog.d/13933.feature b/changelog.d/13933.feature
deleted file mode 100644
index d0cb902dff..0000000000
--- a/changelog.d/13933.feature
+++ /dev/null
@@ -1 +0,0 @@
-Experimental support for thread-specific receipts ([MSC3771](https://github.com/matrix-org/matrix-spec-proposals/pull/3771)).
diff --git a/synapse/storage/databases/main/event_push_actions.py b/synapse/storage/databases/main/event_push_actions.py
index 3e4b4485d6..f4cdc2e399 100644
--- a/synapse/storage/databases/main/event_push_actions.py
+++ b/synapse/storage/databases/main/event_push_actions.py
@@ -1053,7 +1053,7 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas
         )
 
         sql = """
-            SELECT r.room_id, r.user_id, e.stream_ordering
+            SELECT r.stream_id, r.room_id, r.user_id, e.stream_ordering
             FROM receipts_linearized AS r
             INNER JOIN events AS e USING (event_id)
             WHERE ? < r.stream_id AND r.stream_id <= ? AND user_id LIKE ?
@@ -1078,7 +1078,7 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas
 
         # For each new read receipt we delete push actions from before it and
         # recalculate the summary.
-        for room_id, user_id, stream_ordering in rows:
+        for _, room_id, user_id, stream_ordering in rows:
             # Only handle our own read receipts.
             if not self.hs.is_mine_id(user_id):
                 continue
-- 
GitLab