synapse/tests/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
test_account.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_account_data.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_auth.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_auth_issuer.py Expose OIDC discovery information under the CSAPI (#16726) 2023-12-06 13:48:09 +00:00
test_capabilities.py Update license headers 2023-11-21 15:29:58 -05:00
test_consent.py Update license headers 2023-11-21 15:29:58 -05:00
test_devices.py Add Sliding Sync /sync/e2ee endpoint for To-Device messages (#17167) 2024-05-23 12:06:16 -05:00
test_directory.py Update license headers 2023-11-21 15:29:58 -05:00
test_ephemeral_message.py Update license headers 2023-11-21 15:29:58 -05:00
test_events.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_filter.py Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
test_identity.py Update license headers 2023-11-21 15:29:58 -05:00
test_keys.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_login.py Apply user email & picture during OIDC registration if present & selected (#17120) 2024-04-29 15:23:05 +00:00
test_login_token_request.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_media.py Fix slipped logging context when media rejected (#17239) 2024-05-29 11:14:42 +01:00
test_models.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_mutual_rooms.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_notifications.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_password_policy.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_power_levels.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_presence.py Update license headers 2023-11-21 15:29:58 -05:00
test_profile.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_push_rule_attrs.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_read_marker.py Do not refuse to set read_marker if previous event_id is in wrong room (#16990) 2024-03-21 18:43:07 +00:00
test_receipts.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_redactions.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_register.py Send an email if the address is already bound to an user account (#16819) 2024-04-23 16:45:24 +01:00
test_relations.py Stabliize support for MSC3981: recurse /relations (#17023) 2024-04-09 17:11:08 +01:00
test_rendezvous.py MSC4108 implementation (#17056) 2024-04-25 12:50:12 +00:00
test_report_event.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_retention.py Add support for MSC4115 (#17104) 2024-04-29 15:22:13 +01:00
test_rooms.py Add support for MSC3823 - Account Suspension (#17051) 2024-05-01 17:45:17 +01:00
test_sendtodevice.py Add Sliding Sync /sync/e2ee endpoint for To-Device messages (#17167) 2024-05-23 12:06:16 -05:00
test_shadow_banned.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_sync.py Add Sliding Sync /sync endpoint (initial implementation) (#17187) 2024-06-06 14:44:32 -05:00
test_third_party_rules.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_transactions.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_typing.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_upgrade_room.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
utils.py Add Sliding Sync /sync endpoint (initial implementation) (#17187) 2024-06-06 14:44:32 -05:00