diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2022-08-01 13:53:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 13:53:56 +0100 |
commit | 224d792dd7827fb53b9ed3b73a99f4acefb456ba (patch) | |
tree | 1fa31a187862b516245c46e0d55cb77e2e110b26 /synapse/state/__init__.py | |
parent | Enable Complement CI tests in the 'latest deps' test run. (#13213) (diff) | |
download | synapse-224d792dd7827fb53b9ed3b73a99f4acefb456ba.tar.xz |
Refactor `_resolve_state_at_missing_prevs` to return an `EventContext` (#13404)
Previously, `_resolve_state_at_missing_prevs` returned the resolved state before an event and a partial state flag. These were unwieldy to carry around would only ever be used to build an event context. Build the event context directly instead. Signed-off-by: Sean Quah <seanq@matrix.org>
Diffstat (limited to 'synapse/state/__init__.py')
-rw-r--r-- | synapse/state/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py index 69834de0de..c355e4f98a 100644 --- a/synapse/state/__init__.py +++ b/synapse/state/__init__.py @@ -278,6 +278,10 @@ class StateHandler: flag will be calculated based on `event`'s prev events. Returns: The event context. + + Raises: + RuntimeError if `state_ids_before_event` is not provided and one or more + prev events are missing or outliers. """ assert not event.internal_metadata.is_outlier() @@ -432,6 +436,10 @@ class StateHandler: Returns: The resolved state + + Raises: + RuntimeError if we don't have a state group for one or more of the events + (ie. they are outliers or unknown) """ logger.debug("resolve_state_groups event_ids %s", event_ids) |