From 580be61df7224e174a050303a2d215b3fadd80cb Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 14 Jun 2022 17:07:16 +0100 Subject: [PATCH] Conflicted state set is a set of events (#1120) In #1042 I incorrectly wrote that the conflicted state set is a set of pairs (K, V). We later take the union of the conflicted state set and the auth difference. The latter is a set of events (V) only. Fix this by making the conflicted state set a set of events rather than a set of pairs. That is, the conflicted state set is a a `Set[Event]` instead of a `Set[((type, state key), event)]`. --- changelogs/room_versions/newsfragments/1120.clarification | 1 + content/rooms/fragments/v2-state-res.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/room_versions/newsfragments/1120.clarification diff --git a/changelogs/room_versions/newsfragments/1120.clarification b/changelogs/room_versions/newsfragments/1120.clarification new file mode 100644 index 00000000..e8aa3349 --- /dev/null +++ b/changelogs/room_versions/newsfragments/1120.clarification @@ -0,0 +1 @@ +Improve readability and understanding of the state resolution algorithms. \ No newline at end of file diff --git a/content/rooms/fragments/v2-state-res.md b/content/rooms/fragments/v2-state-res.md index e666d7f8..51331b44 100644 --- a/content/rooms/fragments/v2-state-res.md +++ b/content/rooms/fragments/v2-state-res.md @@ -36,10 +36,10 @@ The key-value pairs (*K*, *V*) across all state maps *Si* can be divided into two collections. If a given key *K* is present in every *Si* with the same value *V* in each state map, then the pair (*K*, *V*) belongs to the *unconflicted state map*. -Otherwise (*K*, *V*) belongs to the *conflicted state set*. +Otherwise, *V* belongs to the *conflicted state set*. Note that the unconflicted state map only has one event for each key *K*, -whereas the conflicted state set may associate multiple events to the same key. +whereas the conflicted state set may contain multiple events with the same key. **Auth chain.** The *auth chain* of an event *E* is the set containing all of *E*'s auth events,