summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/_base.py12
-rw-r--r--synapse/storage/event_federation.py4
2 files changed, 14 insertions, 2 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 3ab81a78d5..a23f2b941b 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -447,6 +447,18 @@ class SQLBaseStore(object):
             **d
         )
 
+    def _get_events_txn(self, txn, event_ids):
+        # FIXME (erikj): This should be batched?
+
+        sql = "SELECT * FROM events WHERE event_id = ?"
+
+        event_rows = []
+        for e_id in event_ids:
+            c = txn.execute(sql, (e_id,))
+            event_rows.extend(self.cursor_to_dict(c))
+
+        return self._parse_events_txn(txn, event_rows)
+
     def _parse_events(self, rows):
         return self.runInteraction(
             "_parse_events", self._parse_events_txn, rows
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 06e32d592d..a707030145 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -371,10 +371,10 @@ class EventFederationStore(SQLBaseStore):
                         "_backfill_interaction: got id=%s",
                         *row
                     )
-                    new_front.append(row)
+                    new_front.append(row[0])
 
             front = new_front
             event_results += new_front
 
         # We also want to update the `prev_pdus` attributes before returning.
-        return self._get_pdu_tuples(txn, event_results)
+        return self._get_events_txn(txn, event_results)