mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-04 01:54:13 -04:00
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>
This commit is contained in:
parent
05aeeb3a80
commit
224d792dd7
5 changed files with 68 additions and 86 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue