-
Notifications
You must be signed in to change notification settings - Fork 412
MSC4308: Thread Subscriptions extension to Sliding Sync #4308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
reivilibre
wants to merge
13
commits into
main
Choose a base branch
from
rei/msc_ssext_threadsubs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5f22967
MSC4308 (sliding sync ext. thread subscriptions): init
reivilibre 8ba12b4
Restructure response and add companion endpoint
reivilibre 878f8f5
Fix typo in unstable prefix
reivilibre 6029082
Update proposals/4308-sliding-sync-ext-thread-subscriptions.md
reivilibre 9e03a06
Follow /messages pagination convention a bit more closely
reivilibre ede25df
Fix missing /client in path
reivilibre a5e3e78
Should re-use `to` token
reivilibre 058ce7f
Rejig backpagination to use prev_batch (like /sync <> /messages)
reivilibre 5cf9c90
Split the response format and introduce bump_stamps
reivilibre 5b51570
Add enabled request field
reivilibre cef3446
bump_stamp don't reset between SS sessions or even devices, but maybe…
reivilibre b3ac5ee
bump_stamps are js_ints
reivilibre 4d88858
Try to clarify which token we use
reivilibre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
MSC4308: Thread Subscriptions extension to Sliding Sync | ||
=== | ||
|
||
## Background and Summary | ||
|
||
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). | ||
|
||
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. | ||
|
||
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. | ||
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. | ||
|
||
This MSC proposes an 'extension' to Sliding Sync that allows clients to opt-in to receiving updates to the user's thread subscriptions. | ||
|
||
## Proposal | ||
|
||
The Sliding Sync request format is extended to include the `thread_subscriptions` extension as follows: | ||
|
||
```jsonc | ||
{ | ||
// ... | ||
|
||
"extensions": { | ||
// ... | ||
|
||
// Used to opt-in to receiving updates to thread subscriptions. | ||
"thread_subscriptions": { | ||
// Maximum number of thread subscription changes to receive. | ||
// Defaults to 100. | ||
"limit": 100, | ||
} | ||
} | ||
} | ||
``` | ||
|
||
The response format is then extended to compensate: | ||
|
||
```jsonc | ||
{ | ||
// ... | ||
|
||
"extensions": { | ||
// ... | ||
|
||
// Returns a limited window of updates to thread subscriptions | ||
"thread_subscriptions": { | ||
"changed": [ | ||
{ | ||
"room_id": "!roomid:example.org", | ||
"root_event_id": "$abc123", | ||
|
||
"subscribed": true, | ||
|
||
// must be present when subscribed is true, | ||
// but must be absent when subscribed is false | ||
"automatic": true | ||
}, | ||
reivilibre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"room_id": "!roomid:example.org", | ||
"root_event_id": "$def456", | ||
|
||
"subscribed": false | ||
}, | ||
... | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Potential issues | ||
|
||
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. | ||
reivilibre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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. | ||
|
||
## Alternatives | ||
|
||
|
||
## Limitations | ||
|
||
|
||
## Security considerations | ||
|
||
- No particular security issues anticipated. | ||
|
||
## Unstable prefix | ||
|
||
TODO | ||
|
||
## Dependencies | ||
|
||
- [MSC4186 Sliding Sync](https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md) | ||
- [MSC4306 Threads Subscriptions](https://github.com/matrix-org/matrix-spec-proposals/blob/rei/msc_thread_subscriptions/proposals/4306-thread-subscriptions.md) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled
: boolean here too, for consistency with other extensions (and because the synapse impl requires it, and I was confused as to why my request wasn't taken into account xD)limit
is required, but I wonder if it should? I didn't put it first, assuming the server would give me a nice default value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the enabled flag, sorry for forgetting it!
The
limit
is now opened as a bug in Synapse.