summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2022-10-13 12:15:41 -0400
committerPatrick Cloke <patrickc@matrix.org>2022-10-13 12:15:41 -0400
commit7d59a515bb97dc4f8253aa9a5a560221a0ef4702 (patch)
treea11174c8cf96c17731c15ed12ef559732e18fe3c /synapse/storage
parentAdd an API for listing threads in a room. (#13394) (diff)
downloadsynapse-7d59a515bb97dc4f8253aa9a5a560221a0ef4702.tar.xz
Properly return the thread ID down sync. (#14159)
Fix a broken conflict in e6e876b9b158f47811b6dfedd8783f658ce960a4,
by not stomping over a field right after creating it.
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/databases/main/receipts.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/receipts.py b/synapse/storage/databases/main/receipts.py
index b04026c21b..dc6989527e 100644
--- a/synapse/storage/databases/main/receipts.py
+++ b/synapse/storage/databases/main/receipts.py
@@ -416,10 +416,10 @@ class ReceiptsWorkerStore(SQLBaseStore):
             # {"$foo:bar": { "read": { "@user:host": <receipt> }, .. }, .. }
             event_entry = room_event["content"].setdefault(row["event_id"], {})
             receipt_type = event_entry.setdefault(row["receipt_type"], {})
-            if row["thread_id"]:
-                receipt_type[row["user_id"]]["thread_id"] = row["thread_id"]
 
             receipt_type[row["user_id"]] = db_to_json(row["data"])
+            if row["thread_id"]:
+                receipt_type[row["user_id"]]["thread_id"] = row["thread_id"]
 
         results = {
             room_id: [results[room_id]] if room_id in results else []