Skip to content

Commit f6f3299

Browse files
clokeprichvdh
andauthored
MSC3816: Clarify Thread Participation (#3816)
* Clarify the current_user_participated flag from MSC3440. * Add a better link to the definition. * Clarifications from review. Co-authored-by: Richard van der Hoff <[email protected]> Co-authored-by: Richard van der Hoff <[email protected]>
1 parent 46ae237 commit f6f3299

File tree

2 files changed

+77
-2
lines changed

2 files changed

+77
-2
lines changed

proposals/3440-threading-via-relations.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ would include additional information in the `unsigned` field:
5757
The latest event should be serialised in the same form as the event itself;
5858
this includes adding any bundled aggregations for the event (and applying edits).[^1]
5959
* `count`: An integer counting the number of `m.thread` events
60-
* `current_user_participated`: A flag set to `true` if the current logged in user
61-
has participated in the thread
60+
* `current_user_participated`: A boolean flag, which is set to `true` if the
61+
current logged in user has participated in the thread. The user has participated if:
62+
* They created the current event.
63+
* They created an event with a `m.thread` relation targeting the current event.
6264

6365
#### Rich replies in a thread
6466

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# MSC3816: Clarify Thread Participation
2+
3+
[MSC3440](https://github.com/matrix-org/matrix-doc/pull/3440) defines the `m.thread` relation
4+
type, and the format of the serverside aggregation for them. The definition of the aggregation includes a
5+
`current_user_participated` flag, which is not fully defined:
6+
7+
> A flag set to `true` if the current logged in user has participated in the thread
8+
9+
In particular, it is unclear whether sending the initial event (i.e., the event which is the
10+
target of the `m.thread` relation) counts as participating in the thread.
11+
12+
Known implementations do *not* count the initial event in this way, and instead
13+
implement this as: "has the current user sent an event with an `m.thread` relation
14+
targeting the event", but this has found to give poor user experience in practice.
15+
16+
For example, consider `A` as the root event in a thread from `@alice:example.com`, and `B`
17+
as a threaded reply from `@bob:example.com`. The bundled aggregations for `A`
18+
would include:
19+
20+
| Requester | `current_user_participated` |
21+
|----------------------|-----------------------------|
22+
| `@alice:example.com` | `false` |
23+
| `@bob:example.com` | `true` |
24+
25+
If `@alice:example.com` sends reply `C`, this would change:
26+
27+
| Requester | `current_user_participated` |
28+
|----------------------|-----------------------------|
29+
| `@alice:example.com` | `true` |
30+
| `@bob:example.com` | `true` |
31+
32+
The proposed clarification is that `@alice:example.com` should have always have
33+
participated in the thread (i.e. both tables would be `true` in the example above).
34+
35+
## Proposal
36+
37+
The [definition of the `current_user_participated` flag](https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3440-threading-via-relations.md#event-format)
38+
from the bundled aggregations for `m.thread` relations is updated:
39+
40+
> A boolean flag, which is set to `true` if the current logged in user has
41+
> participated in the thread. The user has participated if:
42+
>
43+
> * They created the current event.
44+
> * They created an event with a `m.thread` relation targeting the current event.
45+
46+
This better matches the intention of this flag, which is that a client is able to
47+
visually separate threads which might be of interest.
48+
49+
## Potential issues
50+
51+
The current implementations will need to be updated to take into account the
52+
sender of the current event when generating bundled aggregations. This should be
53+
trivial since all of the needed information is directly available.
54+
55+
MSC3440 proposes using [new `filter` parameters](https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3440-threading-via-relations.md#fetch-all-threads-in-a-room)
56+
in order to list threads in a room that a user has participated in. There would
57+
now be an inconsistency that threads where the current user sent the root event
58+
but has not replied to the thread could not easily be fetched. A future MSC may
59+
solve this problem.
60+
61+
## Alternatives
62+
63+
Do not clarify [MSC3440](https://github.com/matrix-org/matrix-spec-proposals/pull/3440)
64+
and leave it up to implementations to define the behavior of the
65+
`current_user_participated` flag.
66+
67+
## Security considerations
68+
69+
None
70+
71+
## Unstable prefix
72+
73+
None, the changes above shouldn't dramatically change behavior for clients.

0 commit comments

Comments
 (0)