forked-synapse/synapse/rest/client
Eric Eastwood 4a7c58642c
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": {}
}
```
2024-06-06 14:44:32 -05:00
..
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
_base.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
account_data.py Stabilize support for MSC4010: push rules & account data. (#17022) 2024-04-09 17:11:50 +01:00
account_validity.py Update license headers 2023-11-21 15:29:58 -05:00
account.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
appservice_ping.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
auth_issuer.py Expose OIDC discovery information under the CSAPI (#16726) 2023-12-06 13:48:09 +00:00
auth.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
capabilities.py Update license headers 2023-11-21 15:29:58 -05:00
devices.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
directory.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
events.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
filter.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
initial_sync.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
keys.py Handle OTK uploads off master (#17271) 2024-06-06 17:47:02 +01:00
knock.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
login_token_request.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
login.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
logout.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
media.py Ratelimiting of remote media downloads (#17256) 2024-06-05 13:43:36 +01:00
models.py Add Sliding Sync /sync endpoint (initial implementation) (#17187) 2024-06-06 14:44:32 -05:00
mutual_rooms.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
notifications.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
openid.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
password_policy.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
presence.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
profile.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
push_rule.py Fixups to new push stream (#17038) 2024-03-28 16:29:23 +00:00
pusher.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
read_marker.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
receipts.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
register.py Send an email if the address is already bound to an user account (#16819) 2024-04-23 16:45:24 +01:00
relations.py Stabliize support for MSC3981: recurse /relations (#17023) 2024-04-09 17:11:08 +01:00
rendezvous.py Add note about MSC3886 being closed (#17151) 2024-05-08 12:49:32 +01:00
report_event.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room_keys.py Update license headers 2023-11-21 15:29:58 -05:00
room_upgrade_rest_servlet.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room.py Add Sliding Sync /sync endpoint (initial implementation) (#17187) 2024-06-06 14:44:32 -05:00
sendtodevice.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
sync.py Add Sliding Sync /sync endpoint (initial implementation) (#17187) 2024-06-06 14:44:32 -05:00
tags.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
thirdparty.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
tokenrefresh.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
transactions.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
user_directory.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
versions.py Declare support for Matrix v1.10. (#17082) 2024-04-29 14:09:03 +01:00
voip.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00