diff options
author | Erik Johnston <erik@matrix.org> | 2014-11-11 14:16:41 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-11-11 14:16:41 +0000 |
commit | 5ff0bfb81dfbf27d5c889113d08edb609a2d145a (patch) | |
tree | ba9280186f09559eb79ace3e867f1edaf35d7a4e /synapse/storage/state.py | |
parent | Fix validation tests (diff) | |
download | synapse-5ff0bfb81dfbf27d5c889113d08edb609a2d145a.tar.xz |
Fix bug where we /always/ created a new state group
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r-- | synapse/storage/state.py | 9 |
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) |