diff options
-rw-r--r-- | synapse/storage/state.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py index f23082f1df..eb9fbb8109 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -32,6 +32,8 @@ from synapse.events import EventBase from synapse.types import MutableStateMap, StateMap if TYPE_CHECKING: + from typing import FrozenSet # noqa: used within quoted type hint; flake8 sad + from synapse.server import HomeServer from synapse.storage.databases import Databases @@ -106,7 +108,9 @@ class StateFilter: type_dict.setdefault(typ, set()).add(s) # type: ignore - return StateFilter(types=frozendict(type_dict)) + return StateFilter( + types=frozendict((k, frozenset(v)) for k, v in type_dict.items()) + ) @staticmethod def from_lazy_load_member_list(members: Iterable[str]) -> "StateFilter": @@ -120,7 +124,8 @@ class StateFilter: The new state filter """ return StateFilter( - types=frozendict({EventTypes.Member: set(members)}), include_others=True + types=frozendict({EventTypes.Member: frozenset(members)}), + include_others=True, ) def return_expanded(self) -> "StateFilter": |