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

Allow compute_state_after_events to use partial state #14676

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow compute_state_after_events to use partial state
if fetching a subset of state that is trusted during a partial join.
  • Loading branch information
David Robertson committed Dec 14, 2022
commit a1f7ee2a0e892014855752432fa2e000c05f125f
10 changes: 8 additions & 2 deletions synapse/state/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,20 @@ async def compute_state_after_events(
room_id: the room_id containing the given events.
event_ids: the events whose state should be fetched and resolved.
await_full_state: if `True`, will block if we do not yet have complete state
at the given `event_id`s, regardless of whether `state_filter` is
satisfied by partial state.
at these events and `state_filter` is not satisfied by partial state.
Defaults to `True`.

Returns:
the state dict (a mapping from (event_type, state_key) -> event_id) which
holds the resolution of the states after the given event IDs.
"""
logger.debug("calling resolve_state_groups from compute_state_after_events")
if (
await_full_state
and state_filter
and not state_filter.must_await_full_state(self.hs.is_mine_id)
):
await_full_state = False
ret = await self.resolve_state_groups_for_events(
room_id, event_ids, await_full_state
)
Expand Down