-
- Downloads
Add Sliding Sync `/sync` endpoint (initial implementation) (#17187)
Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync This iteration only focuses on returning the list of room IDs in the sliding window API (without sorting/filtering). Rooms appear in the Sliding sync response based on: - `invite`, `join`, `knock`, `ban` membership events - Kicks (`leave` membership events where `sender` is different from the `user_id`/`state_key`) - `newly_left` (rooms that were left during the given token range, > `from_token` and <= `to_token`) - In order for bans/kicks to not show up, you need to `/forget` those rooms. This doesn't modify the event itself though and only adds the `forgotten` flag to `room_memberships` in Synapse. There isn't a way to tell when a room was forgotten at the moment so we can't factor it into the from/to range. ### Example request `POST http://localhost:8008/_matrix/client/unstable/org.matrix.msc3575/sync` ```json { "lists": { "foo-list": { "ranges": [ [0, 99] ], "sort": [ "by_notification_level", "by_recency", "by_name" ], "required_state": [ ["m.room.join_rules", ""], ["m.room.history_visibility", ""], ["m.space.child", "*"] ], "timeline_limit": 100 } } } ``` Response: ```json { "next_pos": "s58_224_0_13_10_1_1_16_0_1", "lists": { "foo-list": { "count": 1, "ops": [ { "op": "SYNC", "range": [0, 99], "room_ids": [ "!MmgikIyFzsuvtnbvVG:my.synapse.linux.server" ] } ] } }, "rooms": {}, "extensions": {} } ```
Showing
- changelog.d/17187.feature 1 addition, 0 deletionschangelog.d/17187.feature
- synapse/api/constants.py 1 addition, 1 deletionsynapse/api/constants.py
- synapse/handlers/sliding_sync.py 610 additions, 0 deletionssynapse/handlers/sliding_sync.py
- synapse/handlers/sync.py 11 additions, 8 deletionssynapse/handlers/sync.py
- synapse/rest/client/models.py 188 additions, 3 deletionssynapse/rest/client/models.py
- synapse/rest/client/room.py 3 additions, 0 deletionssynapse/rest/client/room.py
- synapse/rest/client/sync.py 229 additions, 1 deletionsynapse/rest/client/sync.py
- synapse/server.py 4 additions, 0 deletionssynapse/server.py
- tests/handlers/test_sliding_sync.py 1118 additions, 0 deletionstests/handlers/test_sliding_sync.py
- tests/rest/client/test_sync.py 133 additions, 1 deletiontests/rest/client/test_sync.py
- tests/rest/client/utils.py 4 additions, 1 deletiontests/rest/client/utils.py
Loading
Please register or sign in to comment