From 03d415a6a23300e36b5e6c35080ac4dd8ab06815 Mon Sep 17 00:00:00 2001
From: Erik Johnston <erik@matrix.org>
Date: Wed, 4 Feb 2015 10:40:59 +0000
Subject: [PATCH] Brief comment on why we do some things on every call to
 persist_event and not others

---
 synapse/storage/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 30ce378900..a63c59a8a2 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -239,6 +239,12 @@ class DataStore(RoomMemberStore, RoomStore,
             event.internal_metadata.get_dict()
         )
 
+        # If we have already persisted this event, we don't need to do any
+        # more processing.
+        # The processing above must be done on every call to persist event,
+        # since they might not have happened on previous calls. For example,
+        # if we are persisting an event that we had persisted as an outlier,
+        # but is no longer one.
         if have_persisted:
             if not outlier:
                 sql = (
-- 
GitLab