diff options
author | David Robertson <davidr@element.io> | 2022-06-15 16:07:47 +0100 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2022-06-15 16:07:47 +0100 |
commit | 6e38e8643fc440d7f7c0b90ec46ea8d36fc89d49 (patch) | |
tree | 16ab5a8b4e9002635ac89d3cc18e505dd15b0baf | |
parent | Changelog (diff) | |
download | synapse-github/dmr/stateres/auth_difference_computation.tar.xz |
Adjust docstring github/dmr/stateres/auth_difference_computation dmr/stateres/auth_difference_computation
-rw-r--r-- | synapse/state/v2.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/state/v2.py b/synapse/state/v2.py index 255173864b..395f44d6d3 100644 --- a/synapse/state/v2.py +++ b/synapse/state/v2.py @@ -381,16 +381,18 @@ async def _get_auth_chain_difference( def _seperate( state_sets: Iterable[StateMap[str]], ) -> Tuple[StateMap[str], Set[str]]: - """Return the unconflicted and conflicted state. This is different than in - the original algorithm, as this defines a key to be conflicted if one of - the state sets doesn't have that key. + """Return the unconflicted state map and the conflicted state set. This differs + from the v1 algorithm: v2 additionally considers a key to be conflicted if one + of the state sets doesn't have that key. Args: state_sets Returns: - A tuple of unconflicted and conflicted state. The conflicted state dict - is a map from type/state_key to set of event IDs + A tuple containing the unconflicted state map and the conflicted state set. + The unconflicted state map is a dict from (type, state_key) to event IDs. + The conflicted state set is an unordered set of event IDs. It may contain + multiple events with the same (type, state_key) pair. """ unconflicted_state: MutableStateMap[str] = {} conflicted_state: Set[str] = set() |