Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Rename to get_partial_current_state_deltas
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed May 25, 2022
1 parent 4771a2e commit 007d01a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/state_deltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class StateDeltasStore(SQLBaseStore):
# attribute. TODO: can we get static analysis to enforce this?
_curr_state_delta_stream_cache: StreamChangeCache

async def get_current_state_deltas(
async def get_partial_current_state_deltas(
self, prev_stream_id: int, max_stream_id: int
) -> Tuple[int, List[Dict[str, Any]]]:
"""Fetch a list of room state changes since the given stream id
Expand All @@ -42,6 +42,8 @@ async def get_current_state_deltas(
- prev_event_id (str|None): previous event_id for this state key. None
if it's new state.
This may be the partial state if we're lazy joining the room.
Args:
prev_stream_id: point to get changes since (exclusive)
max_stream_id: the point that we know has been correctly persisted
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,6 @@ async def get_current_state_deltas(
- list of current_state_delta_stream rows. If it is empty, we are
up to date.
"""
return await self.stores.main.get_current_state_deltas(
return await self.stores.main.get_partial_current_state_deltas(
prev_stream_id, max_stream_id
)
2 changes: 1 addition & 1 deletion tests/handlers/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async def get_users_in_room(room_id: str):
)
)

self.datastore.get_current_state_deltas = Mock(return_value=(0, None))
self.datastore.get_partial_current_state_deltas = Mock(return_value=(0, None))

self.datastore.get_to_device_stream_token = lambda: 0
self.datastore.get_new_device_msgs_for_remote = (
Expand Down

0 comments on commit 007d01a

Please sign in to comment.