summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-09-16 09:56:15 +0100
committerErik Johnston <erik@matrix.org>2015-09-16 09:56:15 +0100
commit16026e60c5381abcfea12f55b57f8d0ce474c402 (patch)
tree871c67ac5af8b6f8db44e6a04d7b033a039a8a94 /synapse/storage
parentBump version/changelog (diff)
parentUpdate changelog (diff)
downloadsynapse-16026e60c5381abcfea12f55b57f8d0ce474c402.tar.xz
Merge branch 'hotfixes-v0.10.0-r2' of github.com:matrix-org/synapse v0.10.0-r2
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/event_federation.py9
-rw-r--r--synapse/storage/events.py2
2 files changed, 11 insertions, 0 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index dda3027b61..7cb314dee8 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -303,6 +303,15 @@ class EventFederationStore(SQLBaseStore):
             ],
         )
 
+        self._update_extremeties(txn, events)
+
+    def _update_extremeties(self, txn, events):
+        """Updates the event_*_extremities tables based on the new/updated
+        events being persisted.
+
+        This is called for new events *and* for events that were outliers, but
+        are are now being persisted as non-outliers.
+        """
         events_by_room = {}
         for ev in events:
             events_by_room.setdefault(ev.room_id, []).append(ev)
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index e3eabab13d..8774b3b388 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -275,6 +275,8 @@ class EventsStore(SQLBaseStore):
                     (False, event.event_id,)
                 )
 
+                self._update_extremeties(txn, [event])
+
         events_and_contexts = filter(
             lambda ec: ec[0] not in to_remove,
             events_and_contexts