Skip to content

Commit c56b003

Browse files
committed
MSC4308 (sliding sync ext. thread subscriptions): init
1 parent 5beaf2e commit c56b003

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
proto-MSC: Threads Subscriptions extension to Sliding Sync
2+
===
3+
4+
## Background and Summary
5+
6+
Threads were introduced in [version 1.4 of the Matrix Specification](https://spec.matrix.org/v1.13/changelog/v1.4/) as a way to isolate conversations in a room, making it easier for users to track specific conversations that they care about (and ignore those that they do not).
7+
8+
Threads Subscriptions are proposed in [MSC4306](https://github.com/matrix-org/matrix-spec-proposals/blob/rei/msc_thread_subscriptions/proposals/4306-thread-subscriptions.md) as a way for users to efficiently indicate which threads they care about, for the purposes of receiving updates.
9+
10+
Sliding Sync is proposed in [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md) as a paginated replacement to `/_matrix/client/v3/sync` with smaller response bodies and lower latency.
11+
The `/_matrix/client/v3/sync` endpoint is notorious in real-world applications of Matrix for producing large response bodies (to the amplified detriment of mobile clients) and the high latency caused by waiting for the server to calculate that full payload.
12+
13+
This MSC proposes an 'extension' to Sliding Sync that allows clients to opt-in to receiving updates to the user's thread subscriptions.
14+
15+
## Proposal
16+
17+
The Sliding Sync request format is extended to include the `thread_subscriptions` extension as follows:
18+
19+
```jsonc
20+
{
21+
// ...
22+
23+
"extensions": {
24+
// ...
25+
26+
// Used to opt-in to receiving updates to thread subscriptions.
27+
"thread_subscriptions": {
28+
// Maximum number of thread subscription changes to receive.
29+
// Defaults to 100.
30+
"limit": 100,
31+
// TODO page_size ? or no?
32+
}
33+
}
34+
}
35+
```
36+
37+
The response format is then extended to compensate:
38+
39+
```jsonc
40+
{
41+
// ...
42+
43+
"extensions": {
44+
// ...
45+
46+
// Returns a limited window of updates to thread subscriptions
47+
"thread_subscriptions": {
48+
"changed": [
49+
{
50+
"room_id": "!roomid:example.org",
51+
"root_event_id": "$abc123",
52+
53+
"subscribed": true,
54+
55+
// must be present when subscribed is true,
56+
// but must be absent when subscribed is false
57+
"automatic": true
58+
},
59+
{
60+
"room_id": "!roomid:example.org",
61+
"root_event_id": "$def456",
62+
63+
"subscribed": false
64+
},
65+
...
66+
]
67+
}
68+
}
69+
}
70+
```
71+
72+
## Potential issues
73+
74+
When clients start a fresh sync with no initial state, it may be the case that there is a backlog of many thread_subscriptions to send down to the client.
75+
76+
Servers MAY choose to return Thread Subscription Settings in an order that is more heuristically-useful to the client, such as 'most recently updated' or 'threads with most recent activity first', instead of 'oldest first'. This could be either for all Thread Subscriptions, or only the backlogged ones.
77+
78+
## Alternatives
79+
80+
81+
## Limitations
82+
83+
84+
## Security considerations
85+
86+
- No particular security issues anticipated.
87+
88+
## Unstable prefix
89+
90+
TODO
91+
92+
## Dependencies
93+
94+
- [MSC4186 Sliding Sync](https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md)
95+
- [MSC4306 Threads Subscriptions](https://github.com/matrix-org/matrix-spec-proposals/blob/rei/msc_thread_subscriptions/proposals/4306-thread-subscriptions.md)

0 commit comments

Comments
 (0)