mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 04:52:17 -04:00
Use immutabledict instead of frozendict (#15113)
Additionally: * Consistently use `freeze()` in test --------- Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
cabe4a3005
commit
3b0083c92a
20 changed files with 123 additions and 243 deletions
|
@ -33,7 +33,7 @@ from typing import (
|
|||
)
|
||||
|
||||
import attr
|
||||
from frozendict import frozendict
|
||||
from immutabledict import immutabledict
|
||||
from prometheus_client import Counter, Histogram
|
||||
|
||||
from synapse.api.constants import EventTypes
|
||||
|
@ -105,14 +105,18 @@ class _StateCacheEntry:
|
|||
#
|
||||
# This can be None if we have a `state_group` (as then we can fetch the
|
||||
# state from the DB.)
|
||||
self._state = frozendict(state) if state is not None else None
|
||||
self._state: Optional[StateMap[str]] = (
|
||||
immutabledict(state) if state is not None else None
|
||||
)
|
||||
|
||||
# the ID of a state group if one and only one is involved.
|
||||
# otherwise, None otherwise?
|
||||
self.state_group = state_group
|
||||
|
||||
self.prev_group = prev_group
|
||||
self.delta_ids = frozendict(delta_ids) if delta_ids is not None else None
|
||||
self.delta_ids: Optional[StateMap[str]] = (
|
||||
immutabledict(delta_ids) if delta_ids is not None else None
|
||||
)
|
||||
|
||||
async def get_state(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue