diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-10-16 07:35:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-16 07:35:22 -0400 |
commit | e3e0ae4ab1f48974ca66a4c4e6be8019aaa38fd1 (patch) | |
tree | fdc93c73b1d80f27454c29541dd90a8b704596dd /synapse/storage/controllers | |
parent | Bump pillow from 10.0.1 to 10.1.0 (#16498) (diff) | |
download | synapse-e3e0ae4ab1f48974ca66a4c4e6be8019aaa38fd1.tar.xz |
Convert state delta processing from a dict to attrs. (#16469)
For improved type checking & memory usage.
Diffstat (limited to 'synapse/storage/controllers')
-rw-r--r-- | synapse/storage/controllers/state.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/synapse/storage/controllers/state.py b/synapse/storage/controllers/state.py index 46957723a1..9f7959c45d 100644 --- a/synapse/storage/controllers/state.py +++ b/synapse/storage/controllers/state.py @@ -16,7 +16,6 @@ from itertools import chain from typing import ( TYPE_CHECKING, AbstractSet, - Any, Callable, Collection, Dict, @@ -32,6 +31,7 @@ from typing import ( from synapse.api.constants import EventTypes, Membership from synapse.events import EventBase from synapse.logging.opentracing import tag_args, trace +from synapse.storage.databases.main.state_deltas import StateDelta from synapse.storage.roommember import ProfileInfo from synapse.storage.util.partial_state_events_tracker import ( PartialCurrentStateTracker, @@ -531,19 +531,9 @@ class StateStorageController: @tag_args async def get_current_state_deltas( self, prev_stream_id: int, max_stream_id: int - ) -> Tuple[int, List[Dict[str, Any]]]: + ) -> Tuple[int, List[StateDelta]]: """Fetch a list of room state changes since the given stream id - Each entry in the result contains the following fields: - - stream_id (int) - - room_id (str) - - type (str): event type - - state_key (str): - - event_id (str|None): new event_id for this state key. None if the - state has been deleted. - - prev_event_id (str|None): previous event_id for this state key. None - if it's new state. - Args: prev_stream_id: point to get changes since (exclusive) max_stream_id: the point that we know has been correctly persisted |