Skip to content

Commit 801dc8d

Browse files
committed
Make clear the thread root is not in the thread
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
1 parent 25a9157 commit 801dc8d

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

content/client-server-api/modules/push.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,16 +1070,16 @@ ahead), however if the `m.read.private` receipt were to be updated to
10701070
event D then the user has read up to D (the `m.read` receipt is now
10711071
behind the `m.read.private` receipt).
10721072

1073-
{{< added-in v="1.4" >}} When handling threaded read receipts, the server
1074-
is to partition the notification count to each thread (with the main timeline
1075-
being its own thread). To determine if an event is part of a thread the
1076-
server follows the [event relationship](#forming-relationships-between-events)
1077-
until it finds a thread root (as specified by the [threading module](#threading)),
1078-
however it is not recommended that the server traverse infinitely. Instead,
1079-
implementations are encouraged to do a maximum of 3 hops to find a thread
1080-
before deciding that the event does not belong to a thread. This is primarily
1081-
to ensure that future events, like `m.reaction`, are correctly considered
1082-
"part of" a given thread.
1073+
{{< added-in v="1.4" >}} When handling threaded read receipts, the server is to
1074+
partition the notification count to each thread (with the main timeline being
1075+
its own thread). To determine if an event is part of a thread the server follows
1076+
the [event relationship](#forming-relationships-between-events) until it finds a
1077+
thread root via an `m.thread` relation (as specified by the [threading
1078+
module](#threading)), however it is not recommended that the server traverse
1079+
infinitely. Instead, implementations are encouraged to do a maximum of 3 hops to
1080+
find a thread before deciding that the event does not belong to a thread. This
1081+
is primarily to ensure that future events, like `m.reaction`, are correctly
1082+
considered "part of" a given thread.
10831083

10841084
#### Server behaviour
10851085

content/client-server-api/modules/receipts.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,22 @@ either a thread root's event ID or `main` for the main timeline.
137137

138138
Threading introduces a concept of multiple conversations being held in the same
139139
room and thus deserve their own read receipts and notification counts. An event is
140-
considered to be "in a thread" if it meets any of the following criteria:
141-
* It has a `rel_type` of `m.thread`.
142-
* It has child events with a `rel_type` of `m.thread` (in which case it'd be the
143-
thread root).
144-
* Following the event relationships, it has a parent event which qualifies for
145-
one of the above. Implementations should not recurse infinitely, though: a
146-
maximum of 3 hops is recommended to cover indirect relationships.
147-
148-
Events not in a thread but still in the room are considered to be part of the
149-
"main timeline", or a special thread with an ID of `main`.
140+
considered to be "in a thread" if:
141+
142+
* It has a rel_type of m.thread, or
143+
* It has a parent event with this rel_type, or a parent of a parent, or further
144+
up the chain of relations. (Implementations should not recurse to arbitrary
145+
depth: a maximum of 3 hops is recommended to cover indirect relationships.)
146+
147+
Events not in a thread but still in the room are considered to be in the "main
148+
timeline". Threaded receipts for the main timeine use a special thread ID of
149+
`main`.
150+
151+
Thread roots are considered to be in the main timeline, as are events that are
152+
related to a thread root via non-thread relations. Note that clients providing a
153+
single-thread view will probably want to include thread roots and some of their
154+
child events (e.g. reactions) in that view, even though from a receipt point of
155+
view they are not part of that thread.
150156

151157
The following is an example DAG for a room, with dotted lines showing event
152158
relationships and solid lines showing topological ordering.

content/client-server-api/modules/threading.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ as by providing some context to what is going on in the thread but keeping the f
1212
history behind a disclosure.
1313

1414
Threads are established using a `rel_type` of `m.thread` and reference the
15-
*thread root* (the first event in a thread). It is not possible to create a
16-
thread from an event which itself is the child of an event relationship (i.e.,
17-
one with an `m.relates_to` property). It is therefore also not possible to nest
18-
threads. All events in a thread reference the thread root instead of the
19-
most recent message, unlike rich reply chains.
15+
*thread root*. It is not possible to create a thread from an event which itself
16+
is the child of an event relationship (i.e., one with an `m.relates_to`
17+
property). It is therefore also not possible to nest threads. All events in a
18+
thread reference the thread root instead of the most recent message, unlike rich
19+
reply chains.
2020

2121
As a worked example, the following represents a thread and how it would be formed:
2222

0 commit comments

Comments
 (0)