forked-synapse/synapse/handlers
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
..
ui_auth Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
__init__.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
account_data.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
account_validity.py Merge remote-tracking branch 'gitlab/clokep/license-license' into new_develop 2023-12-13 15:11:56 +00:00
account.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
admin.py Use fully-qualified PersistedEventPosition when returning RoomsForUser (#17265) 2024-06-04 12:58:03 -05:00
appservice.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
auth.py Bump mypy from 1.5.1 to 1.8.0 (#16901) 2024-03-13 17:05:57 +00:00
cas.py Allows CAS SSO flow to provide user IDs composed of numbers only (#17098) 2024-05-14 13:55:32 +01:00
deactivate_account.py Redact membership events if the user requested erasure upon deactivating (#17076) 2024-04-25 14:25:31 +01:00
device.py Reduce work of calculating outbound device pokes (#17211) 2024-05-22 13:55:18 +01:00
devicemessage.py Ignore attempts to send to-device messages to bad users (#17240) 2024-05-29 11:52:48 +01:00
directory.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
e2e_keys.py Handle OTK uploads off master (#17271) 2024-06-06 17:47:02 +01:00
e2e_room_keys.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
event_auth.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
events.py Add support for MSC4115 (#17104) 2024-04-29 15:22:13 +01:00
federation_event.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
federation.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
identity.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
initial_sync.py Use fully-qualified PersistedEventPosition when returning RoomsForUser (#17265) 2024-06-04 12:58:03 -05:00
jwt.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
message.py Fix deduplicating of membership events to not create unused state groups. (#17164) 2024-05-30 11:33:48 +00:00
oidc.py Add OIDC config to add extra parameters to the authorize URL (#16971) 2024-03-22 10:35:11 +00:00
pagination.py Use fully-qualified PersistedEventPosition when returning RoomsForUser (#17265) 2024-06-04 12:58:03 -05:00
password_policy.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
presence.py Bump black from 23.10.1 to 24.2.0 (#16936) 2024-03-13 16:46:44 +00:00
profile.py Fix undiscovered linter errors (#17166) 2024-05-08 14:57:32 +00:00
push_rules.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
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
receipts.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
register.py Log exceptions when failing to auto-join new user according to the auto_join_rooms option. (#17176) 2024-05-22 14:22:33 +01:00
relations.py Don't invalidate all get_relations_for_event on history purge (#17083) 2024-05-29 12:57:10 +01:00
room_list.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room_member_worker.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room_member.py Fix deduplicating of membership events to not create unused state groups. (#17164) 2024-05-30 11:33:48 +00:00
room_summary.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
room.py Use fully-qualified PersistedEventPosition when returning RoomsForUser (#17265) 2024-06-04 12:58:03 -05:00
saml.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
search.py Add support for MSC4115 (#17104) 2024-04-29 15:22:13 +01:00
send_email.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
set_password.py Update license headers 2023-11-21 15:29:58 -05:00
sliding_sync.py Add Sliding Sync /sync endpoint (initial implementation) (#17187) 2024-06-06 14:44:32 -05:00
sso.py Bring auto-accept invite logic into Synapse (#17147) 2024-05-21 20:09:17 +00:00
state_deltas.py Update license headers 2023-11-21 15:29:58 -05:00
stats.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
typing.py Fix bug where typing replication breaks (#17252) 2024-05-31 16:07:05 +01:00
user_directory.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
worker_lock.py Improve lock performance when a lot of locks are waiting (#16840) 2024-03-14 13:49:54 +00:00