summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-11 14:16:41 +0000
committerErik Johnston <erik@matrix.org>2014-11-11 14:16:41 +0000
commit5ff0bfb81dfbf27d5c889113d08edb609a2d145a (patch)
treeba9280186f09559eb79ace3e867f1edaf35d7a4e /synapse/storage
parentFix validation tests (diff)
downloadsynapse-5ff0bfb81dfbf27d5c889113d08edb609a2d145a.tar.xz
Fix bug where we /always/ created a new state group
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/state.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index e08acd6404..68975969f5 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -16,11 +16,6 @@
 from ._base import SQLBaseStore
 from twisted.internet import defer
 
-from collections import namedtuple
-
-
-StateGroup = namedtuple("StateGroup", ("group", "state"))
-
 
 class StateStore(SQLBaseStore):
 
@@ -37,7 +32,7 @@ class StateStore(SQLBaseStore):
             if group:
                 groups.add(group)
 
-        res = []
+        res = {}
         for group in groups:
             state_ids = yield self._simple_select_onecol(
                 table="state_groups_state",
@@ -53,7 +48,7 @@ class StateStore(SQLBaseStore):
                 if s:
                     state.append(s)
 
-            res.append(StateGroup(group, state))
+            res[group] = state
 
         defer.returnValue(res)