summary refs log tree commit diff
path: root/synapse/state.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-31 10:09:46 +0100
committerErik Johnston <erik@matrix.org>2016-08-31 10:09:46 +0100
commit1bb8ec296de4f6bf37b0b31f28bc0d7285f96ba0 (patch)
treefe0f7c6986c94fe48fe66bebd4030072f3a3ecfd /synapse/state.py
parentMake _state_groups_id_gen a normal IdGenerator (diff)
downloadsynapse-1bb8ec296de4f6bf37b0b31f28bc0d7285f96ba0.tar.xz
Generate state group ids in state layer
Diffstat (limited to 'synapse/state.py')
-rw-r--r--synapse/state.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/state.py b/synapse/state.py
index daec983dc9..147416fd81 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -160,14 +160,14 @@ class StateHandler(object):
             else:
                 context.current_state_ids = {}
             context.prev_state_events = []
-            context.state_group = None
+            context.state_group = self.store.get_next_state_group()
             defer.returnValue(context)
 
         if old_state:
             context.current_state_ids = {
                 (s.type, s.state_key): s.event_id for s in old_state
             }
-            context.state_group = None
+            context.state_group = self.store.get_next_state_group()
 
             if event.is_state():
                 key = (event.type, event.state_key)
@@ -193,7 +193,10 @@ class StateHandler(object):
         group, curr_state = ret
 
         context.current_state_ids = curr_state
-        context.state_group = group if not event.is_state() else None
+        if event.is_state() or group is None:
+            context.state_group = self.store.get_next_state_group()
+        else:
+            context.state_group = group
 
         if event.is_state():
             key = (event.type, event.state_key)