Commit graph

23801 commits

Author SHA1 Message Date
Eric Eastwood
9bdfa16b3e Merge branch 'develop' into madlittlemods/msc3575-sliding-sync-e2ee
Conflicts:
	synapse/handlers/sync.py
	tests/handlers/test_sync.py
2024-05-16 13:10:58 -05:00
Eric Eastwood
c856ae4724
Refactor SyncResultBuilder assembly to its own function (#17202)
We will re-use `get_sync_result_builder(...)` in
https://github.com/element-hq/synapse/pull/17167

Split out from https://github.com/element-hq/synapse/pull/17167
2024-05-16 13:05:31 -05:00
Eric Eastwood
fe07995e69
Fix joined_rooms/joined_room_ids usage (#17208)
This change was introduced in
https://github.com/element-hq/synapse/pull/17203

But then https://github.com/element-hq/synapse/pull/17207 was reverted
which brought back usage `joined_rooms` that needed to be updated.
Wasn't caught because `develop` wasn't up to date before merging.
2024-05-16 17:27:38 +00:00
Eric Eastwood
52a649580f
Rename to be obvious: joined_rooms -> joined_room_ids (#17203)
Split out from https://github.com/element-hq/synapse/pull/17167
2024-05-16 11:55:51 -05:00
Eric Eastwood
28a948f04f
Removed request_key from the SyncConfig (moved outside as its own function parameter) (#17201)
Removed `request_key` from the `SyncConfig` (moved outside as its own function parameter) so it doesn't have to flow into `_generate_sync_entry_for_xxx` methods. This way we can separate the concerns of caching from generating the response and reuse the `_generate_sync_entry_for_xxx` functions as we see fit. Plus caching doesn't really have anything to do with the config of sync.

Split from https://github.com/element-hq/synapse/pull/17167

Spawning from https://github.com/element-hq/synapse/pull/17167#discussion_r1601497279
2024-05-16 11:54:46 -05:00
Andrew Morgan
7cb3f8a979
Route /make_knock and /send_knock to workers in Complement docker image (#17195) 2024-05-16 16:53:26 +00:00
Erik Johnston
fd12003441
Revert "Improve perf of sync device lists" (#17207)
Reverts element-hq/synapse#17191
2024-05-16 16:07:54 +01:00
Erik Johnston
5e892671a7
Fix bug where push rules would be empty in /sync (#17142)
Fixes #16987

Some old accounts seem to have an entry in global account data table for
push rules, which we should ignore
2024-05-16 15:04:14 +01:00
Eric Eastwood
d2d48cce85
Refactor Sync handler to be able to return different sync responses (SyncVersion) (#17200)
Refactor Sync handler to be able to be able to return different sync
responses (`SyncVersion`). Preparation to be able support sync v2 and a
new Sliding Sync `/sync/e2ee` endpoint which returns a subset of sync
v2.

Split upon request:
https://github.com/element-hq/synapse/pull/17167#discussion_r1601497279

Split from https://github.com/element-hq/synapse/pull/17167 where we
will add `SyncVersion.E2EE_SYNC` and a new type of sync response.
2024-05-16 11:36:54 +01:00
Andrew Morgan
2359c64dec
Fix request path for federation_whitelist_endpoint_enabled option in documentation (#17199) 2024-05-15 17:26:22 +01:00
Andrew Morgan
68dca8076f Merge branch 'master' into develop 2024-05-14 15:21:42 +01:00
Erik Johnston
284d85dee3
Cache literal sync filter validation (#17186)
The sliding sync proxy (amongst other things) use literal json blobs as
filters, and repeatedly validating them takes a bunch of CPU.
2024-05-14 15:08:46 +01:00
Erik Johnston
ebe77381b0
Reduce pauses on large device list changes (#17192)
For large accounts waking up all the relevant notifier streams can cause
pauses of the reactor.
2024-05-14 14:39:11 +01:00
Erik Johnston
0b91ccce47
Improve perf of sync device lists (#17191)
It's almost always more efficient to query the rooms that have device
list changes, rather than looking at the list of all users whose devices
have changed and then look for shared rooms.
2024-05-14 14:39:04 +01:00
Andrew Morgan
ecf4e0674c 1.107.0 2024-05-14 14:15:41 +01:00
Aurélien Grimpard
7d82987b27
Allows CAS SSO flow to provide user IDs composed of numbers only (#17098) 2024-05-14 13:55:32 +01:00
dependabot[bot]
bd8d8865fb
Bump serde_json from 1.0.116 to 1.0.117 (#17182) 2024-05-14 09:32:23 +01:00
dependabot[bot]
caf528477e
Bump serde from 1.0.200 to 1.0.201 (#17183) 2024-05-14 09:32:14 +01:00
dependabot[bot]
f0c72d8e87
Bump gitpython from 3.1.41 to 3.1.43 (#17181) 2024-05-14 09:32:01 +01:00
dependabot[bot]
03a342b049
Bump cryptography from 42.0.5 to 42.0.7 (#17180) 2024-05-14 09:31:46 +01:00
dependabot[bot]
aa6345cb3b
Bump immutabledict from 4.1.0 to 4.2.0 (#17179) 2024-05-14 09:31:35 +01:00
dependabot[bot]
2b438df9b3
Bump sentry-sdk from 1.40.3 to 2.1.1 (#17178) 2024-05-14 09:31:25 +01:00
Erik Johnston
038b9ec59a
An federation whitelist query endpoint extension (#16848)
This is to allow clients to query the configured federation whitelist.
Disabled by default.

---------

Co-authored-by: Devon Hudson <devonhudson@librem.one>
Co-authored-by: devonh <devon.dmytro@gmail.com>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2024-05-13 19:38:45 +00:00
Erik Johnston
59ac541310
Actually fix public rooms (#17184)
See #17177.

I'm an idiot and moved them to the wrong store 🤦
2024-05-13 13:11:07 +01:00
Erik Johnston
a2e6f43f11
Fix bug with creating public rooms on workers (#17177)
If room publication is disabled then creating public rooms on workers
would not work.

Introduced in #16811.
2024-05-13 12:12:26 +01:00
Eric Eastwood
b9e5379836 Describe test 2024-05-09 15:15:40 -05:00
Eric Eastwood
6b7cfd7037 Add tests for device_unused_fallback_key_types in /sync 2024-05-09 15:11:27 -05:00
Eric Eastwood
f09835556e Add device_one_time_keys_count tests 2024-05-09 14:41:04 -05:00
Eric Eastwood
adb7e20ddd Consolidate device_lists /sync tests 2024-05-09 13:55:36 -05:00
Eric Eastwood
0892283f44 Add comments docs 2024-05-09 13:39:16 -05:00
Eric Eastwood
8871dac779 Share tests using inheritance
See https://github.com/element-hq/synapse/pull/17167#discussion_r1594517041
-> https://stackoverflow.com/questions/28333478/python-unittest-testcase-with-inheritance
2024-05-09 10:25:35 -05:00
ll-SKY-ll
4cf4a8281b
Update docs to bump libjemalloc version on latest debian; correct "push_rules" stream name (#17171) 2024-05-09 10:50:05 +00:00
Eric Eastwood
6bf48968eb Try calculate more 2024-05-08 23:50:31 -05:00
Eric Eastwood
10ffae6c50 Shared logic for get_sync_result_builder() 2024-05-08 15:14:40 -05:00
Eric Eastwood
c60a4f84ac Add changelog 2024-05-08 13:59:50 -05:00
Eric Eastwood
b8b70ba1ba Fix lint 2024-05-08 12:44:55 -05:00
Eric Eastwood
06d12e50a2 Ugly overloads 2024-05-08 12:43:57 -05:00
Eric Eastwood
371ec57555 Fix wait_for_sync_for_user in tests 2024-05-08 12:19:56 -05:00
Eric Eastwood
d4ff933748 Prefer Sync v2 vs Sliding Sync distinction
We were using the enum just to distinguish /sync v2
vs Sliding Sync /sync/e2ee so we should just make an
enum for that instead of trying to glom onto the
existing `sync_type` (overloading it).
2024-05-08 11:53:59 -05:00
Andrew Morgan
ef7e040e54
Bump black from 24.2.0 to 24.4.2 (#17170) 2024-05-08 17:02:09 +01:00
Eric Eastwood
69f91436cf Comment on tests 2024-05-08 10:54:54 -05:00
Eric Eastwood
5e925f621c Share tests with test_sendtodevice 2024-05-08 10:48:59 -05:00
devonh
393429d692
Fix undiscovered linter errors (#17166)
Linter errors are showing up in #17147 that are unrelated to that PR.
The errors do not currently show up on develop.

This PR aims to resolve the linter errors separately from #17147.
2024-05-08 14:57:32 +00:00
Timshel
34a8652366
Optional whitespace support in Authorization (#1350) (#17145)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2024-05-08 13:56:16 +00:00
Erik Johnston
414ddcd457
Update PyO3 to 0.21 (#17162)
This version change requires a migration to a new API. See
https://pyo3.rs/v0.21.2/migration#from-020-to-021

This will fix the annoying warnings added when using the recent rust
nightly:

> warning: non-local `impl` definition, they should be avoided as they
go against expectation
2024-05-08 14:30:06 +01:00
Andrew Morgan
4d408cb4dd
Note preset behaviour in autocreate_auto_join_room_preset docs (#17150) 2024-05-08 13:05:10 +01:00
Hugh Nimmo-Smith
212f150208
Add note about MSC3886 being closed (#17151) 2024-05-08 12:49:32 +01:00
Eric Eastwood
1e05a05f03 Add Sliding Sync /sync/e2ee endpoint for To-Device messages
Based on:

 - MSC3575: Sliding Sync (aka Sync v3): https://github.com/matrix-org/matrix-spec-proposals/pull/3575
 - MSC3885: Sliding Sync Extension: To-Device messages: https://github.com/matrix-org/matrix-spec-proposals/pull/3885
 - MSC3884: Sliding Sync Extension: E2EE: https://github.com/matrix-org/matrix-spec-proposals/pull/3884
2024-05-07 18:16:35 -05:00
Olivier 'reivilibre
4c6e78fa14 Merge branch 'release-v1.107' into develop 2024-05-07 18:52:15 +01:00
Jacob Sánchez
1b155362ca
Add note about external_ids for User Admin API in documentation (#17139) 2024-05-07 16:38:29 +00:00