|
| 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