summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Bump ruff from 0.5.0 to 0.5.4 (#17466)dependabot[bot]2024-07-222-21/+21
|
* Bump sentry-sdk from 2.8.0 to 2.10.0 (#17467)dependabot[bot]2024-07-221-3/+3
|
* Prepare for authenticated media freeze (#17433)Shay2024-07-2212-12/+362
| | | | | | As part of the rollout of [MSC3916](https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3916-authentication-for-media.md) this PR adds support for designating authenticated media and ensuring that authenticated media is not served over unauthenticated endpoints.
* Add a cache on `get_rooms_for_local_user_where_membership_is` (#17460)Erik Johnston2024-07-196-4/+38
| | | | | | | As it gets used in sliding sync. We basically invalidate it in all the same places as `get_rooms_for_user`. Most of the changes are due to needing the arguments you pass in to be hashable (which lists aren't)
* Generate room sync data concurrently (#17458)Erik Johnston2024-07-192-2/+11
| | | This is also what we do for standard `/sync`.
* Bump sentry-sdk from 2.6.0 to 2.8.0 (#17456)dependabot[bot]2024-07-191-5/+5
|
* Improve default_power_level_content_override documentation (#17451)Ben Banfield-Zanin2024-07-183-0/+35
| | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Revert "Bump setuptools from 67.6.0 to 70.0.0" (#17455)Erik Johnston2024-07-181-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts element-hq/synapse#17448 We hit a bug when deploying with synctl: ``` Traceback (most recent call last): File "/home/synapse/env-python311/bin/synctl", line 33, in <module> sys.exit(load_entry_point('matrix-synapse', 'console_scripts', 'synctl')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/bin/synctl", line 25, in importlib_load_entry_point return next(matches).load() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/metadata/__init__.py", line 202, in load module = import_module(match.group('module')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/synapse/src/synapse/_scripts/synctl.py", line 37, in <module> from synapse.config import find_config_files File "/home/synapse/src/synapse/config/__init__.py", line 22, in <module> from ._base import ConfigError, find_config_files File "/home/synapse/src/synapse/config/_base.py", line 49, in <module> import pkg_resources File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3282, in <module> @_call_aside ^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3266, in _call_aside f(*args, **kwargs) File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3295, in _initialize_master_working_set working_set = _declare_state('object', 'working_set', WorkingSet._build_master()) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 589, in _build_master ws.require(__requires__) File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 926, in require needed = self.resolve(parse_requirements(requirements)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 787, in resolve dist = self._resolve_dist( ^^^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 816, in _resolve_dist env = Environment(self.entries) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1014, in __init__ self.scan(search_path) File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1046, in scan for dist in find_distributions(item): File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2091, in find_on_path yield from factory(fullpath) ^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2183, in resolve_egg_link return next(dist_groups, ()) ^^^^^^^^^^^^^^^^^^^^^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2179, in <genexpr> resolved_paths = ( ^ File "/home/synapse/env-python311/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2167, in non_empty_lines for line in _read_utf8_with_fallback(path).splitlines(): ^^^^^^^^^^^^^^^^^^^^^^^^ NameError: name '_read_utf8_with_fallback' is not defined ```
* Add `m.room.create` to default bump event types (#17453)Eric Eastwood2024-07-182-0/+2
| | | | | | Add `m.room.create` to default bump event types This probably helps when no messages have been sent in the room and it was just created.
* Order `heroes` by `stream_ordering` (as spec'ed) (#17435)Eric Eastwood2024-07-174-26/+456
| | | | | | | | | | | | | The spec specifically mentions `stream_ordering` but that's a Synapse specific concept. In any case, the essence of the spec is basically the first 5 members of the room which `stream_ordering` accomplishes. Split off from https://github.com/element-hq/synapse/pull/17419#discussion_r1671342794 ## Spec compliance > This should be the first 5 members of the room, **ordered by stream ordering**, which are joined or invited. The list must never include the client’s own user ID. When no joined or invited members are available, this should consist of the banned and left users. > > *-- https://spec.matrix.org/v1.10/client-server-api/#_matrixclientv3sync_roomsummary* Related to https://github.com/matrix-org/matrix-spec/issues/1334
* Merge branch 'master' into developTill Faelligen2024-07-163-1/+14
|\
| * 1.111.0 v1.111.0Till Faelligen2024-07-163-1/+14
| |
* | Bump mypy from 1.9.0 to 1.10.1 (#17445)dependabot[bot]2024-07-162-29/+30
| |
* | Bump matrix-org/done-action from 2 to 3 (#17440)dependabot[bot]2024-07-161-2/+2
| |
* | Handle remote download responses with `UNKNOWN_LENGTH` more gracefully (#17439)Shay2024-07-164-60/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this PR, remote downloads which did not provide a `content-length` were decremented from the remote download ratelimiter at the max allowable size, leading to excessive ratelimiting - see https://github.com/element-hq/synapse/issues/17394. This PR adds a linearizer to limit concurrent remote downloads to 6 per IP address, and decrements remote downloads without a `content-length` from the ratelimiter *after* the download is complete and the response length is known. Also adds logic to ensure that responses with a known length respect the `max_download_size`.
* | Bump setuptools from 67.6.0 to 70.0.0 (#17448)dependabot[bot]2024-07-161-7/+6
| |
* | Remove unnecessary call to resume producing in fake channel (#17449)Shay2024-07-162-4/+1
| | | | | | | | | | This fell out of the authenticated media work - this bit of code masked a bug but does not break anything when removed, so probably should be removed.
* | Fix bug where sync could get stuck when using workers (#17438)Erik Johnston2024-07-154-10/+138
| | | | | | | | This is because we serialized the token wrong if the instance map contained entries from before the minimum token.
* | Bump types-jsonschema from 4.22.0.20240610 to 4.23.0.20240712 (#17446)dependabot[bot]2024-07-151-3/+3
| |
* | Bump bytes from 1.6.0 to 1.6.1 (#17441)dependabot[bot]2024-07-151-2/+2
| |
* | Bump ulid from 1.1.2 to 1.1.3 (#17442)dependabot[bot]2024-07-151-2/+2
| |
* | Bump jsonschema from 4.22.0 to 4.23.0 (#17444)dependabot[bot]2024-07-151-4/+4
| |
* | Bump twine from 5.1.0 to 5.1.1 (#17443)dependabot[bot]2024-07-151-4/+4
| |
* | Make sure we use the right logic for enabling the media repo. (#17424)Quentin Gliech2024-07-154-8/+3
| | | | | | | | | | This removes the `enable_media_repo` attribute on the server config in favour of always using the `can_load_media_repo` in the media config. This should avoid issues like in #17420 in the future
* | Add room subscriptions to Sliding Sync `/sync` (#17432)Eric Eastwood2024-07-155-358/+1489
| | | | | | | | | | | | | | | | | | | | | | | | | | Add room subscriptions to Sliding Sync `/sync` Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync Currently, you can only subscribe to rooms you have had *any* membership in before. In the future, we will allow `world_readable` rooms to be subscribed to without joining.
* | Add `is_dm` room field to Sliding Sync `/sync` (#17429)Eric Eastwood2024-07-113-29/+70
| | | | | | | | | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* | Add `heroes` and room summary fields to Sliding Sync `/sync` (#17419)Eric Eastwood2024-07-116-110/+529
| | | | | | | | | | | | | | Additional room summary fields: `joined_count`, `invited_count` Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* | Fix filtering room types on remote rooms (#17434)Erik Johnston2024-07-114-13/+130
| | | | | | | | | | | | We can only fetch room types for rooms the server is in, so we need to only filter rooms that we're joined to. Also includes a perf fix to bulk fetch room types.
* | Fix docs on `record_action` to clarify the actions are applied (#17426)Travis Ralston2024-07-112-3/+3
| | | | | | | | | | This looks like a copy/paste error: the function doesn't reject anything, but instead allows the action count to go through regardless. The remainder of the function's documentation appears correct.
* | Add Red Hat Enterprise Linux and Rocky Linux installation instructions (#17423)villepeh2024-07-113-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added RHEL/Rocky install instructions (PyPI). Instructions cover versions 8 and 9 which are the only supported ones - except for RHEL7 which is now on extended life cycle support phase. Large part of the guide is for installing Python 3.11 or 3.12. RHEL8 ships with Python 3.6 and RHEL9 ships with 3.9. Newer Python versions can be installed easily as they don't interfere with OS software that still relies on the default Python version. I was first planning to add prerequisites part to the prerequisites section and then install instructions on the top of the page but that section is for pre-built packages so it just didn't sound right. So I just dumped everything to the PyPI section of the page. But suggestions to change are welcome. I also didn't combine these with Fedora section. I haven't tested those packages on RHEL and Fedora ships with Python 3.12 out-of-box.
* | Use consistent casing between FROM and AS (#17431)Joe Groocock2024-07-112-3/+3
| | | | | | Signed-off-by: Joe Groocock <me@frebib.net>
* | Bump zipp from 3.15.0 to 3.19.1 (#17427)dependabot[bot]2024-07-111-6/+6
| |
* | Upload new logo with white bg and update readme to use it (#17387)Will Lewis2024-07-103-1/+96
| |
* | Handle to-device extensions to Sliding Sync (#17416)Erik Johnston2024-07-106-12/+392
| | | | | | | | | | | | | | Implements MSC3885 --------- Co-authored-by: Eric Eastwood <eric.eastwood@beta.gouv.fr>
* | Merge branch 'release-v1.111' into developQuentin Gliech2024-07-108-5/+31
|\|
| * 1.111.0rc2 v1.111.0rc2Quentin Gliech2024-07-106-4/+24
| |
| * Fix new media APIs when using synapse.app.media_repository (#17420)Erik Johnston2024-07-093-2/+3
| | | | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
| * Note the new federated media worker endpoints in the worker docs & upgrade ↵Andrew Morgan2024-07-093-2/+5
| | | | | | | | notes (#17421)
| * Route auth'd fed media requests to media repo in Complement tests (#17422)Andrew Morgan2024-07-092-0/+2
| |
* | Add `rooms` `name` and `avatar` to Sliding Sync `/sync` (#17418)Eric Eastwood2024-07-093-55/+305
|/ | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* Fix up the changelog v1.111.0rc1Quentin Gliech2024-07-092-3/+2
|
* Merge remote-tracking branch 'origin/develop' into release-v1.111Quentin Gliech2024-07-092-1/+3
|\
| * Fix exception when failing to talk to remote server (#17411)Erik Johnston2024-07-092-1/+3
| | | | | | Broke in #17381
* | Tweak the changelog for v1.111.0rc1Quentin Gliech2024-07-091-8/+7
| | | | | | | | Co-authored-by: Andrew Morgan <andrewm@element.io>
* | 1.111.0rc1Quentin Gliech2024-07-0925-25/+61
|/
* Fix `/versions` requests (#17410)Erik Johnston2024-07-093-1/+11
| | | | | We need it to work on workers and allow guest access. Broke by #17392
* Bump ijson from 3.2.3 to 3.3.0 (#17413)dependabot[bot]2024-07-091-90/+95
|
* Bump pillow from 10.3.0 to 10.4.0 (#17412)dependabot[bot]2024-07-091-71/+82
|
* Fix bug in sliding sync when using old DB. (#17398)Erik Johnston2024-07-088-212/+33
| | | | | | | | | We don't necessarily have `instance_name` for old events (before we support multiple event persisters). We treat those as if the `instance_name` was "master". --------- Co-authored-by: Eric Eastwood <eric.eastwood@beta.gouv.fr>
* Add `rooms.bump_stamp` to Sliding Sync `/sync` for easier client-side ↵Eric Eastwood2024-07-089-34/+295
| | | | | | | | | | | | | | | sorting (#17395) `bump_stamp` corresponds to the `stream_ordering` of the latest `DEFAULT_BUMP_EVENT_TYPES` in the room. This helps clients sort more readily without them needing to pull in a bunch of the timeline to determine the last activity. `bump_event_types` is a thing because for example, we don't want display name changes to mark the room as unread and bump it to the top. For encrypted rooms, we just have to consider any activity as a bump because we can't see the content and the client has to figure it out for themselves. Outside of Synapse, `bump_stamp` is just a free-form counter so other implementations could use `received_ts`or `origin_server_ts` (see the [*Security considerations* section in MSC3575 about the potential pitfalls of using `origin_server_ts`](https://github.com/matrix-org/matrix-spec-proposals/blob/kegan/sync-v3/proposals/3575-sync.md#security-considerations)). It doesn't have any guarantee about always going up. In the Synapse case, it could go down if an event was redacted/removed (or purged in cases of retention policies). In the future, we could add `bump_event_types` as [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575) mentions if people need to customize the event types. --- In the Sliding Sync proxy, a similar [`timestamp` field was added](https://github.com/matrix-org/sliding-sync/pull/247) for the same purpose but the name is not obvious what it pertains to or what it's for. The `timestamp` field was also added to Ruma in https://github.com/ruma/ruma/pull/1622
* Bump serde_json from 1.0.119 to 1.0.120 (#17408)dependabot[bot]2024-07-081-2/+2
|
* Bump serde from 1.0.203 to 1.0.204 (#17409)dependabot[bot]2024-07-081-4/+4
|
* Bump mypy-zope from 1.0.4 to 1.0.5 (#17414)dependabot[bot]2024-07-081-4/+3
|
* Bump pydantic from 2.7.1 to 2.8.2 (#17415)dependabot[bot]2024-07-081-85/+98
|
* Declare support for Matrix 1.11 (#17403)Travis Ralston2024-07-082-0/+2
| | | | | | | | Previous: https://github.com/element-hq/synapse/pull/17082 Fixes https://github.com/element-hq/synapse/issues/17402 See https://github.com/element-hq/synapse/issues/17402 for context **Blocked on https://github.com/element-hq/synapse/pull/17388** (required for spec compliance)
* MSC3861: allow overriding the introspection endpoint (#17406)Quentin Gliech2024-07-083-2/+20
| | | | This makes it easier to go through an internal endpoint instead of the public facing URL when introspecting tokens, reducing latency.
* Bump certifi from 2023.7.22 to 2024.7.4 (#17404)dependabot[bot]2024-07-081-4/+4
|
* Support MSC3916 by adding a federation /thumbnail endpoint and authenticated ↵Shay2024-07-0812-131/+585
| | | | | | | | | | | | | | `_matrix/client/v1/media/thumbnail` endpoint (#17388) [MSC3916](https://github.com/matrix-org/matrix-spec-proposals/pull/3916) added the endpoints `_matrix/federation/v1/media/thumbnail` and the authenticated `_matrix/client/v1/media/thumbnail`. This PR implements those endpoints, along with stabilizing `_matrix/client/v1/media/config` and `_matrix/client/v1/media/preview_url`. Complement tests are at https://github.com/matrix-org/complement/pull/728
* Bump ruff from 0.3.7 to 0.5.0 (#17381)dependabot[bot]2024-07-0513-36/+41
|
* Allow enabling sliding sync per-user (#17393)Erik Johnston2024-07-057-6/+89
| | | Based on #17392
* Finish up work to allow per-user feature flags (#17392)Erik Johnston2024-07-058-49/+189
| | | | | | | Follows on from @H-Shay's great work at https://github.com/matrix-org/synapse/pull/15344 and MSC4026. Also enables its use for MSC3881, mainly as an easy but concrete example of how to use it.
* Fix links to MSC3916 (#17397)Sandro2024-07-052-2/+2
|
* Upon deactivation, forget all of the user's rooms (#17400)Travis Ralston2024-07-053-0/+27
| | | | | | This can help ensure that the rooms are eventually purged if the other local users also forget them. Synapse already clears some of the room information as part of the `_background_remove_left_rooms` background task, but this doesn't catch `events`, `event_json`, etc.
* Fix links in README (#17379)Hugh Nimmo-Smith2024-07-052-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think this warrants a changelog? ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [ ] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
* Make the release script create a release branch for Complement as well (#17318)Quentin Gliech2024-07-052-1/+25
|
* Add `rooms.required_state` to Sliding Sync `/sync` (#17342)Eric Eastwood2024-07-049-89/+1687
| | | Also handles excluding rooms with partial state when people are asking for room membership events unless it's `$LAZY` room membership.
* Changelog entries only get merged if they have the same content and ↵Eric Eastwood2024-07-042-3/+4
| | | | | | | | | | extension (#17399) Changelog entries only get merged if they have the same content and extension See https://github.com/element-hq/synapse/pull/17301#discussion_r1665387218
* Merge branch 'master' into developDevon Hudson2024-07-033-1/+14
|\
| * 1.110.0 v1.110.0 release-v1.110Devon Hudson2024-07-033-1/+14
| |
* | Add `room_types`/`not_room_types` filtering to Sliding Sync `/sync` (#17337)Eric Eastwood2024-07-025-7/+248
| | | | | | | | | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* | Return some room data in Sliding Sync `/sync` (#17320)Eric Eastwood2024-07-0214-259/+3593
| | | | | | | | | | | | - Timeline events - Stripped `invite_state` Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* | Merge branch 'release-v1.110' into developDevon Hudson2024-07-027-5/+21
|\|
| * 1.110.0rc3 v1.110.0rc3Devon Hudson2024-07-027-5/+21
| |
* | Merge remote-tracking branch 'origin/release-v1.110' into developErik Johnston2024-07-025-10/+57
|\|
| * Limit size of presence EDUs (#17371)Erik Johnston2024-07-023-11/+140
| | | | | | | | | | | | | | Otherwise they are unbounded. --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
| * Fix regression when bounding future tokens (#17391)Erik Johnston2024-07-023-10/+54
| | | | | | | | | | | | Fix bug added in #17386, where we accidentally used `room_key` for the receipts stream. See first commit. Reviewable commit-by-commit
| * Fix sync waiting for an invalid token from the "future" (#17386)Erik Johnston2024-07-0217-31/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/element-hq/synapse/issues/17274, hopefully. Basically, old versions of Synapse could advance streams without persisting anything in the DB (fixed in #17229). On restart those updates would get lost, and so the position of the stream would revert to an older position. If this happened across an upgrade to a later Synapse version which included #17215, then sync could get blocked indefinitely (until the stream advanced to the position in the token). We fix this by bounding the stream positions we'll wait for to the maximum position of the underlying stream ID generator.
| * Fix building debian packages for sid (#17389)Erik Johnston2024-07-022-0/+3
| | | | | | | | | | Sid now defaults to python3.12, and our pinned version of cffi (1.5.1) does not have wheels for 3.12. This installing cffi to fail as we did not have the correct libs installed to build from source.
* | Support MSC3916 by adding `_matrix/client/v1/media/download` endpoint (#17365)Shay2024-07-0226-84/+1718
| |
* | Fix sync waiting for an invalid token from the "future" (#17386)Erik Johnston2024-07-0217-31/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/element-hq/synapse/issues/17274, hopefully. Basically, old versions of Synapse could advance streams without persisting anything in the DB (fixed in #17229). On restart those updates would get lost, and so the position of the stream would revert to an older position. If this happened across an upgrade to a later Synapse version which included #17215, then sync could get blocked indefinitely (until the stream advanced to the position in the token). We fix this by bounding the stream positions we'll wait for to the maximum position of the underlying stream ID generator.
* | Fix building debian packages on non-clean checkouts (#17390)Erik Johnston2024-07-022-0/+4
| | | | | | | | | | If we leave the `.so` in place it causes the tests to fail, as it gets picked up (instead of the newly built .so) and so fails with mismatched GLIBC errors.
* | Bump types-setuptools from 69.5.0.20240423 to 70.1.0.20240627 (#17380)dependabot[bot]2024-07-011-3/+3
| |
* | Bump serde_json from 1.0.117 to 1.0.119 (#17385)dependabot[bot]2024-07-011-2/+2
| |
* | Bump log from 0.4.21 to 0.4.22 (#17384)dependabot[bot]2024-07-011-2/+2
| |
* | Bump cryptography from 42.0.7 to 42.0.8 (#17382)dependabot[bot]2024-07-011-33/+33
| |
* | Limit size of presence EDUs (#17371)Erik Johnston2024-07-013-11/+140
| | | | | | | | | | | | | | Otherwise they are unbounded. --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* | Clarify `url_preview_url_blacklist` is a usability feature (#17356)davidegirardi2024-06-282-9/+13
| |
* | Use rstcheck to "lint" the README (#17367)Till2024-06-272-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up to https://github.com/element-hq/synapse/pull/17363, so we can detect issues with the RST file early on. ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
* | Handle multiple rows device inbox (#17362)Erik Johnston2024-06-272-3/+3
| | | | | | | | | | | | | | | | | | | | Fix bug where we don't get new to-device from remote if they resent a message we've already persisted and have recorded in the DB twice. `device_federation_inbox` table doesn't have a unique index, and so we can race and store an entry in there twice. If we do so then `simple_select_one_txn` will throw an error due to the query returning more than one row. We should add an unique index, but it doesn't really matter so lets just handle the case of multiple rows correctly for now.
* | Merge branch 'release-v1.110' into developTill Faelligen2024-06-2646-49/+101
|\|
| * 1.110.0rc2 v1.110.0rc2Till Faelligen2024-06-264-2/+16
| |
| * Fix uploading packages to PyPi (#17363)Till2024-06-262-7/+8
| | | | | | | | | | | | As per https://github.com/sphinx-doc/sphinx/issues/3921#issuecomment-315581557, we need double underscores. Running `rst2html README.rst > /dev/null` found some more warnings.
| * Fix typo v1.110.0rc1Till Faelligen2024-06-261-1/+1
| |
| * Update changelogTill Faelligen2024-06-261-8/+6
| |
| * 1.110.0rc1Till Faelligen2024-06-2646-49/+88
| |
* | Fix uploading packages to PyPi (#17363)Till2024-06-262-7/+8
|/ | | | | | As per https://github.com/sphinx-doc/sphinx/issues/3921#issuecomment-315581557, we need double underscores. Running `rst2html README.rst > /dev/null` found some more warnings.
* Fixes to the table of contents in the README (#17329)Andrew Morgan2024-06-252-4/+5
|
* Fix outdated Security Disclosure Policy references (#17341)Denis Kasak2024-06-254-5/+6
|
* Re-introduce federation /download endpoint (#17350)Shay2024-06-258-11/+588
|
* Fix refreshable_access_token_lifetime typo (#17357)douglaz2024-06-251-1/+1
| | | Simple typo in the docs
* Limit amount of replication we send (#17358)Erik Johnston2024-06-252-8/+8
| | | | | | | | | Fixes up #17333, where we failed to actually send less data (the `DISTINCT` didn't work due to `stream_id` being different). We fix this by making it so that every device list outbound poke for a given user ID has the same stream ID. We can't change the query to only return e.g. max stream ID as the receivers look up the destinations to send to by doing `SELECT WHERE stream_id = ?`
* Reintroduce "Reduce device lists replication traffic."" (#17361)Erik Johnston2024-06-256-48/+89
| | | | | | Reintroduces https://github.com/element-hq/synapse/pull/17333 Turns out the reason for revert was down two master instances running
* Revert "Reduce device lists replication traffic." (#17360)Erik Johnston2024-06-256-89/+48
| | | | | | Reverts element-hq/synapse#17333 It looks like master was still sending out replication RDATA with the old format... somehow
* Add `is_invite` filtering to Sliding Sync `/sync` (#17335)Eric Eastwood2024-06-244-43/+199
| | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* Correct error in user_directory docs (#17348)devonh2024-06-242-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [X] Pull request is based on the develop branch * [X] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [X] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: reivilibre <oliverw@matrix.org>
* Add default values for rc_invites per_issuer to docs (#17347)devonh2024-06-242-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A simple change to update the docs where default values were missing. ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [X] Pull request is based on the develop branch * [X] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [X] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: Kim Brose <2803622+HarHarLinks@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Fix room `type` typo in mailer (#17336)Eric Eastwood2024-06-242-2/+4
| | | | | Correct event content field is `EventContentFields.ROOM_TYPE` (`type`) :white_check_mark: , not `room_type` :x: Spec: https://spec.matrix.org/v1.10/client-server-api/#mroomcreate
* Reintroduce #17291. (#17338)Erik Johnston2024-06-247-89/+250
| | | | | | | This is #17291 (which got reverted), with some added fixups, and change so that tests actually pick up the error. The problem was that we were not calculating any new chain IDs due to a missing `not` in a condition.
* Add support for MSC3823 - Account Suspension Part 2 (#17255)Shay2024-06-249-0/+287
|
* Reduce device lists replication traffic. (#17333)Erik Johnston2024-06-246-48/+89
| | | | | | | | | | Reduce the replication traffic of device lists, by not sending every destination that needs to be sent the device list update over replication. Instead a "hosts to send to have been calculated" notification over replication, and then federation senders read the destinations from the DB. For non federation senders this should heavily reduce the impact of a user in many large rooms changing a device.
* Tidy up integer parsing (#17339)Denis Kasak2024-06-248-34/+25
| | | | | | | | | | The parse_integer function was previously made to reject negative values by default in https://github.com/element-hq/synapse/pull/16920, but the documentation stated otherwise. This fixes the documentation and also: - Removes explicit negative=False parameters from call sites. - Brings the negative default of parse_integer_from_args in alignment with parse_integer.
* Bump lazy_static from 1.4.0 to 1.5.0 (#17355)dependabot[bot]2024-06-241-2/+2
|
* Bump typing-extensions from 4.11.0 to 4.12.2 (#17354)dependabot[bot]2024-06-241-3/+3
|
* Bump netaddr from 1.2.1 to 1.3.0 (#17353)dependabot[bot]2024-06-241-3/+3
|
* Bump packaging from 24.0 to 24.1 (#17352)dependabot[bot]2024-06-241-4/+4
|
* Bump sentry-sdk from 2.3.1 to 2.6.0 (#17351)dependabot[bot]2024-06-241-4/+4
|
* Bump urllib3 from 2.0.7 to 2.2.2 (#17346)dependabot[bot]2024-06-211-5/+5
|
* Bump requests from 2.31.0 to 2.32.2 (#17345)dependabot[bot]2024-06-211-4/+4
|
* Bump tornado from 6.4 to 6.4.1 (#17344)dependabot[bot]2024-06-211-15/+15
|
* Bump authlib from 1.3.0 to 1.3.1 (#17343)dependabot[bot]2024-06-211-3/+3
|
* Revert "Handle large chain calc better (#17291)" (#17334)Erik Johnston2024-06-195-230/+82
| | | | | | This reverts commit bdf82efea505c488953b46eb681b5a63c4e9655d (#17291) This seems to have stopped persisting auth chains for new events, and so is causing state res to fall back to the slow methods
* Register sliding sync under a different path (#17331)Erik Johnston2024-06-193-2/+5
| | | As the API is slightly incompatible.
* register-new-matrix-user: add a flag to ignore already existing users (#17304)Jörg Thalheim2024-06-194-3/+34
| | | | Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
* Filter added to Admin-API GET /rooms (#17276)Alexander Fechler2024-06-195-15/+131
|
* Update the README with Element branding and a few fixes (#17324)Andrew Morgan2024-06-192-25/+51
| | | | Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
* Remove `expire_access_token` from Docker configuration (#17198)Aaron Dewes2024-06-192-1/+1
| | | | Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
* Handle large chain calc better (#17291)Erik Johnston2024-06-195-82/+230
| | | | | We calculate the auth chain links outside of the main persist event transaction to ensure that we do not block other event sending during the calculation.
* Require the 'from' parameter for `/notifications` be an integer (#17283)Andrew Morgan2024-06-195-21/+173
| | | | Co-authored-by: Erik Johnston <erikj@element.io>
* Revert "Support MSC3916 by adding a federation `/download` endpoint" (#17325)Andrew Morgan2024-06-1811-659/+25
|
* register_new_matrix_user: add password-file flag (#17294)Jörg Thalheim2024-06-184-7/+29
| | | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
* Merge branch 'master' into developQuentin Gliech2024-06-184-5/+20
|\
| * 1.109.0 v1.109.0 release-v1.109Quentin Gliech2024-06-184-2/+16
| |
| * Switch to macOS 12 runners to fix building of wheels for macOS (#17319)Quentin Gliech2024-06-182-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the release artefacts workflow to use `macos-12` runners instead of `macos-11`, as the latter will be fully deprecated in a few days. This also updates `cibuildwheel` to a newer version, as it would not 'repair' the macOS wheels correctly The difference is that now instead of outputting a macOS 11+ compatible wheel, we output a macOS 12+ compatible one. This is fine, as macOS 11 is considered EOL since September 2023. We can also expect that macOS 12 will be considered EOL in September 2024, as Apple usually supports the last 3 macOS version, and macOS 15 is scheduled to be released around that time.
* | Add support for via query parameter from MSC4156 (#17322)Johannes Marbach2024-06-184-0/+20
| | | | | | | | This adds support for the `via` query parameter from https://github.com/matrix-org/matrix-spec-proposals/pull/4156.
* | fix missing quotes for exclude_rooms_from_sync (#17308)Dirk Klimpel2024-06-182-1/+2
| | | | | | | | | | We tried to configure rooms `exclude_rooms_from_sync`. If we do not quote we get an error. The example should be valid.
* | Bump types-pyyaml from 6.0.12.12 to 6.0.12.20240311 (#17316)dependabot[bot]2024-06-181-4/+4
| |
* | Bump docker/build-push-action from 5 to 6 (#17312)dependabot[bot]2024-06-181-1/+1
| |
* | Bump dawidd6/action-download-artifact from 5 to 6 (#17313)dependabot[bot]2024-06-181-1/+1
| |
* | Bump types-netaddr from 1.2.0.20240219 to 1.3.0.20240530 (#17314)dependabot[bot]2024-06-181-3/+3
| |
* | Bump phonenumbers from 8.13.37 to 8.13.39 (#17315)dependabot[bot]2024-06-181-3/+3
| |
* | Bump msgpack from 1.0.7 to 1.0.8 (#17317)dependabot[bot]2024-06-181-57/+57
| |
* | Add `is_encrypted` filtering to Sliding Sync `/sync` (#17281)Eric Eastwood2024-06-175-100/+189
| | | | | | | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* | Add `stream_ordering` sort to Sliding Sync `/sync` (#17293)Eric Eastwood2024-06-179-121/+459
| | | | | | Sort is no longer configurable and we always sort rooms by the `stream_ordering` of the last event in the room or the point where the user can see up to in cases of leave/ban/invite/knock.
* | Merge branch 'release-v1.109' into developQuentin Gliech2024-06-178-216/+193
|\|
| * 1.109.0rc3 v1.109.0rc3Quentin Gliech2024-06-176-4/+20
| |
| * Set our own stream position from the current sequence value on startup (#17309)Quentin Gliech2024-06-173-178/+147
| |
| * Use the release branch for sytest in release-branch PRs (#17306)Quentin Gliech2024-06-172-0/+4
| |
| * Automatically apply SQL for inconsistent sequence (#17305)Erik Johnston2024-06-144-37/+25
| | | | | | | | | | | | Rather than forcing the server operator to apply the SQL manually. This should be safe, as there should be only one writer for these sequences.
* | Enable cross-signing key upload without UIA (#17284)Richard van der Hoff2024-06-147-123/+32
| | | | | | | | | | | | Per MSC3967, which is now stable, we should not require UIA when uploading cross-signing keys for the first time. Fixes: #17227
* | Include user membership on events (#17282)Richard van der Hoff2024-06-1318-45/+8
| | | | | | | | | | MSC4115 has now completed FCP, so we can enable it by default and switch to the stable identifier.
* | Add `is_dm` filtering to Sliding Sync `/sync` (#17277)Eric Eastwood2024-06-135-7/+416
| | | | | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* | Fix `newly_left` rooms not appearing if we returned early (Sliding Sync) ↵Eric Eastwood2024-06-133-14/+15
| | | | | | | | | | | | | | | | | | | | | | (#17301) Fix `newly_left` rooms not appearing if we returned early when `membership_snapshot_token.is_before_or_eq(to_token.room_key)`. Introduced in https://github.com/element-hq/synapse/pull/17187 (part of Sliding Sync) The tests didn't catch it because they had a small typo in it `room_id1` vs `room_id2`. Found while working on https://github.com/element-hq/synapse/pull/17293
* | Add `event.internal_metadata.instance_name` (#17300)Eric Eastwood2024-06-1310-9/+31
| | | | | | | | | | | | | | | | | | | | Add `event.internal_metadata.instance_name` (the worker instance that persisted the event) to go alongside the existing `event.internal_metadata.stream_ordering`. `instance_name` is useful to properly compare and query for events with a token since you need to compare both the `stream_ordering` and `instance_name` against the vector clock/`instance_map` in the `RoomStreamToken`. This is pre-requisite work and may be used in https://github.com/element-hq/synapse/pull/17293 Adding `event.internal_metadata.instance_name` was first mentioned in the initial Sliding Sync PR while pairing with @erikjohnston, see https://github.com/element-hq/synapse/pull/17187/commits/09609cb0dbca3a4cfd9fbf90cc962e765ec469c0#diff-5cd773fb307aa754bd3948871ba118b1ef0303f4d72d42a2d21e38242bf4e096R405-R410
* | Fix `get_last_event_in_room_before_stream_ordering(...)` finding the wrong ↵Eric Eastwood2024-06-133-12/+290
| | | | | | | | | | | | | | | | | | | | | | last event (#17295) PR where this was introduced: https://github.com/matrix-org/synapse/pull/14817 ### What does this affect? `get_last_event_in_room_before_stream_ordering(...)` is used in Sync v2 in a lot of different state calculations. `get_last_event_in_room_before_stream_ordering(...)` is also used in `/rooms/{roomId}/members`
* | Bump `mypy` from 1.8.0 to 1.9.0 (#17297)Andrew Morgan2024-06-134-40/+82
| | | | | | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* | Clarify that MSC4151 is enabled on matrix.org (#17296)Quentin Gliech2024-06-132-1/+10
| | | | | | | | | | This clarifies in the comments that the MSC is being used in matrix.org See #17270
* | Add report room API (MSC4151) (#17270)Travis Ralston2024-06-129-8/+210
| | | | | | | | | | | | | | | | https://github.com/matrix-org/matrix-spec-proposals/pull/4151 This is intended to be enabled by default for immediate use. When FCP is complete, the unstable endpoint will be dropped and stable endpoint supported instead - no backwards compatibility is expected for the unstable endpoint.
* | Bump types-jsonschema from 4.21.0.20240311 to 4.22.0.20240610 (#17288)dependabot[bot]2024-06-121-3/+3
| |
* | Bump jinja2 from 3.1.3 to 3.1.4 (#17287)dependabot[bot]2024-06-121-3/+3
| |
* | Merge branch 'release-v1.109' into developQuentin Gliech2024-06-115-10/+52
|\|
| * CHANGES.md: s/OTKs/one-time-keys/ v1.109.0rc2Quentin Gliech2024-06-111-1/+1
| |
| * 1.109.0rc2Quentin Gliech2024-06-115-3/+17
| |
| * Fix bug where device lists would break sync (#17292)Erik Johnston2024-06-103-9/+36
| | | | | | | | | | | | | | | | | | | | If the stream ID in the unconverted table is ahead of the device lists ID gen, then it can break all /sync requests that had an ID from ahead of the table. The fix is to make sure we add the unconverted table to the list of tables we check at start up. Broke in https://github.com/element-hq/synapse/pull/17229
| * Update changelogErik Johnston2024-06-101-1/+1
| |
| * Always return OTK counts (#17275)Erik Johnston2024-06-102-4/+30
| | | | | | Broke in https://github.com/element-hq/synapse/pull/17215
* | Bump regex from 1.10.4 to 1.10.5 (#17290)dependabot[bot]2024-06-111-2/+2
| |
* | Bump dawidd6/action-download-artifact from 3.1.4 to 5 (#17289)dependabot[bot]2024-06-111-1/+1
| |
* | Bump types-pillow from 10.2.0.20240423 to 10.2.0.20240520 (#17285)dependabot[bot]2024-06-111-3/+3
| |
* | Reorganize Pydantic models and types used in handlers (#17279)Eric Eastwood2024-06-1015-244/+269
| | | | | | | | | | | | Spawning from https://github.com/element-hq/synapse/pull/17187#discussion_r1619492779 around wanting to put `SlidingSyncBody` (parse the request in the rest layer), `SlidingSyncConfig` (from the rest layer, pass to the handler), `SlidingSyncResponse` (pass the response from the handler back to the rest layer to respond) somewhere that doesn't contaminate the imports and cause circular import issues. - Moved Pydantic parsing models to `synapse/types/rest` - Moved handler types to `synapse/types/handlers`
* | Wrong retention policy being used when filtering events (lint ↵Eric Eastwood2024-06-102-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ControlVarUsedAfterBlockViolation` `WPS441`) (#17272) Fix loop var being used outside block. Before this change, we were always using the last room_id's retention policy for all events being filtered. I found this bug with the [new lint rule, `ControlVarUsedAfterBlockViolation` `WPS441`](https://github.com/astral-sh/ruff/pull/11769), that I re-implemented in `ruff`. Shout-out to @reivilibre for all the help in the beginning! ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
* | Support MSC3916 by adding a federation `/download` endpoint (#17172)Shay2024-06-0710-24/+659
| |
* | Add debug logging for when room keys are uploaded, including whether they ↵reivilibre2024-06-072-0/+19
| | | | | | | | | | | | | | | | | | | | | | are replacing other room keys. (#17266) Fixes: #17013 Add logging for whether room keys are replaced This is motivated by the Crypto team who need to diagnose crypto issues. The existing opentracing logging is not enough because it is not enabled for all users.
* | Add Sliding Sync `/sync` endpoint (initial implementation) (#17187)Eric Eastwood2024-06-0611-15/+2302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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": {} } ```
* | Handle OTK uploads off master (#17271)Erik Johnston2024-06-063-38/+60
| | | | | | And fallback keys uploads. Only device keys need handling on master
* | Don't try and resync devices for down hosts (#17273)Erik Johnston2024-06-062-6/+19
| | | | | | | | It's just a waste of time if we won't even query the remote host as its marked as down.
* | Always return OTK counts (#17275)Erik Johnston2024-06-062-4/+30
| | | | | | Broke in https://github.com/element-hq/synapse/pull/17215
* | Ratelimiting of remote media downloads (#17256)Shay2024-06-0512-14/+372
| |
* | Handle hyphens in user dir search porperly (#17254)Erik Johnston2024-06-054-6/+104
| | | | | | c.f. #16675
* | Use fully-qualified `PersistedEventPosition` when returning `RoomsForUser` ↵Eric Eastwood2024-06-0411-75/+85
| | | | | | | | | | | | | | (#17265) Use fully-qualified `PersistedEventPosition` (`instance_name` and `stream_ordering`) when returning `RoomsForUser` to facilitate proper comparisons and `RoomStreamToken` generation. Spawning from https://github.com/element-hq/synapse/pull/17187 where we want to utilize this change
* | Merge branch 'release-v1.109' into developAndrew Morgan2024-06-0425-23/+61
|\|
| * Fix typo in CHANGES.md v1.109.0rc1Andrew Morgan2024-06-041-1/+1
| |
| * 1.109.0rc1Andrew Morgan2024-06-0425-23/+61
| |
* | Bump sentry-sdk from 2.1.1 to 2.3.1 (#17263)dependabot[bot]2024-06-041-4/+4
|/
* Bump types-pyopenssl from 24.0.0.20240311 to 24.1.0.20240425 (#17260)dependabot[bot]2024-06-031-3/+18
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump mypy-zope from 1.0.3 to 1.0.4 (#17262)dependabot[bot]2024-06-031-4/+4
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump lxml from 5.2.1 to 5.2.2 (#17261)dependabot[bot]2024-06-031-156/+144
| | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix bug where typing replication breaks (#17252)Erik Johnston2024-05-313-4/+56
| | | | This can happen on restarts of the service, due to old rooms being pruned.
* Fix logging errors when receiving invalid User ID for key querys (#17250)Erik Johnston2024-05-312-0/+6
|
* Fix sentry default tags (#17251)Erik Johnston2024-05-312-10/+11
| | | | | This was broken by the sentry 2.0 upgrade Broke in v1.108.0
* In sync wait for worker to catch up since token (#17215)Erik Johnston2024-05-307-7/+134
| | | | | | | Otherwise things will get confused. An alternative would be to make sure that for lagging stream we don't return anything (and make sure the returned next_batch token doesn't go backwards). But that is a faff.
* Fix deduplicating of membership events to not create unused state groups. ↵Erik Johnston2024-05-304-35/+54
| | | | | | | | | | | | | (#17164) We try and deduplicate in two places: 1) really early on, and 2) just before we persist the event. The first case was broken due to it occuring before the profile information was added, and so it thought the event contents were different. The second case did catch it and handle it correctly, however doing so creates a redundant state group leading to bloat. Fixes #3791
* Replaces all usages of `StreamIdGenerator` with `MultiWriterIdGenerator` ↵Erik Johnston2024-05-3010-363/+227
| | | | | (#17229) Replaces all usages of `StreamIdGenerator` with `MultiWriterIdGenerator`, which is safer.
* Clean out invalid destinations from outbox (#17242)Erik Johnston2024-05-303-0/+92
| | | | We started ensuring we only insert valid destinations: https://github.com/element-hq/synapse/pull/17240
* Ensure we delete media if we reject due to spam check (#17246)Erik Johnston2024-05-303-32/+33
| | | | | | | | Fixes up #17239 We need to keep the spam check within the `try/except` block. Also makes it so that we don't enter the top span twice. Also also ensures that we get the right thumbnail length.
* Move towards using `MultiWriterIdGenerator` everywhere (#17226)Erik Johnston2024-05-2910-379/+341
| | | | | | | | | | | | | | | There is a problem with `StreamIdGenerator` where it can go backwards over restarts when a stream ID is requested but then not inserted into the DB. This is problematic if we want to land #17215, and is generally a potential cause for all sorts of nastiness. Instead of trying to fix `StreamIdGenerator`, we may as well move to `MultiWriterIdGenerator` that does not suffer from this problem (the latest positions are stored in `stream_positions` table). This involves adding SQLite support to the class. This only changes id generators that were already using `MultiWriterIdGenerator` under postgres, a separate PR will move the rest of the uses of `StreamIdGenerator` over.
* Don't invalidate all `get_relations_for_event` on history purge (#17083)Erik Johnston2024-05-296-13/+41
| | | | This is a tree cache already, so may as well move the room ID to the front and use that
* Change allow_unsafe_locale to also apply on new databases (#17238)Erik Johnston2024-05-293-7/+13
| | | | We relax this as there are use cases where this is safe, though it is still highly recommended that people avoid using it.
* Ignore attempts to send to-device messages to bad users (#17240)Erik Johnston2024-05-292-0/+8
| | | | | | | | Currently sending a to-device message to a user ID with a dodgy destination is accepted, but then ends up spamming the logs when we try and send to the destination. An alternative would be to reject the request, but I'm slightly nervous that could break things.
* Handle duplicate OTK uploads racing (#17241)Erik Johnston2024-05-292-33/+46
| | | Currently this causes one of then to 500.
* Fix slipped logging context when media rejected (#17239)Erik Johnston2024-05-296-91/+55
| | | | | | | When a module rejects a piece of media we end up trying to close the same logging context twice. Instead of fixing the existing code we refactor to use an async context manager, which is easier to write correctly.
* Merge branch 'master' into developOlivier 'reivilibre2024-05-283-1/+14
|\
| * 1.108.0 v1.108.0 release-v1.108Olivier 'reivilibre2024-05-283-1/+14
| |
* | Bump phonenumbers from 8.13.35 to 8.13.37 (#17235)dependabot[bot]2024-05-281-3/+3
| |
* | Bump pyicu from 2.13 to 2.13.1 (#17236)dependabot[bot]2024-05-281-2/+2
| |
* | Bump pyopenssl from 24.0.0 to 24.1.0 (#17234)dependabot[bot]2024-05-281-4/+4
| |
* | Bump prometheus-client from 0.19.0 to 0.20.0 (#17233)dependabot[bot]2024-05-281-3/+3
| |
* | Bump serde from 1.0.202 to 1.0.203 (#17232)dependabot[bot]2024-05-281-4/+4
| |
* | Support MSC3916 by adding unstable media endpoints to `_matrix/client` (#17213)Shay2024-05-247-549/+2393
| | | | | | | | | | | | | | | | | | | | [MSC3916](https://github.com/matrix-org/matrix-spec-proposals/blob/rav/authentication-for-media/proposals/3916-authentication-for-media.md) adds new media endpoints under `_matrix/client`. This PR adds the `/preview_url`, `/config`, and `/thumbnail` endpoints. `/download` will be added in a follow-up PR once the work for the federation `/download` endpoint is complete (see https://github.com/element-hq/synapse/pull/17172). Should be reviewable commit-by-commit.
* | Add Sliding Sync `/sync/e2ee` endpoint for To-Device messages (#17167)Eric Eastwood2024-05-237-175/+861
| | | | | | | | | | | | | | | | | | | | | | This is being introduced as part of Sliding Sync but doesn't have any sliding window component. It's just a way to get E2EE events without having to sit through a big initial sync (`/sync` v2). And we can avoid encryption events being backed up by the main sync response or vice-versa. Part of some Sliding Sync simplification/experimentation. See [this discussion](https://github.com/element-hq/synapse/pull/17167#discussion_r1610495866) for why it may not be as useful as we thought. Based on: - https://github.com/matrix-org/matrix-spec-proposals/pull/3575 - https://github.com/matrix-org/matrix-spec-proposals/pull/3885 - https://github.com/matrix-org/matrix-spec-proposals/pull/3884
* | Log exceptions when failing to auto-join new user according to the ↵reivilibre2024-05-222-1/+2
| | | | | | | | | | | | | | `auto_join_rooms` option. (#17176) Would have been useful for tracking down #16878. Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
* | Add logging to tasks managed by the task scheduler, showing CPU and database ↵reivilibre2024-05-222-2/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usage. (#17219) The log format is the same as the request log format, except: - fields that are specific to HTTP requests have been removed - the task's params are included at the end of the log line. These log lines are emitted: - when the task function finishes — both completion and failure (and I suppose it is possible for a task to become schedulable again?) - every 5 minutes whilst it is running Closes #17217. --------- Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
* | Reduce work of calculating outbound device pokes (#17211)Erik Johnston2024-05-223-0/+32
| |
* | Update Lemonldap-NG OIDC config (#17204)Yadd2024-05-222-0/+3
| | | | | | | | Update OIDC documentation: by default Matrix doesn't query userinfo endpoint, then claims should be put on id_token.
* | Bring auto-accept invite logic into Synapse (#17147)devonh2024-05-2111-1/+945
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR ports the logic from the [synapse_auto_accept_invite](https://github.com/matrix-org/synapse-auto-accept-invite) module into synapse. I went with the naive approach of injecting the "module" next to where third party modules are currently loaded. If there is a better/preferred way to handle this, I'm all ears. It wasn't obvious to me if there was a better location to add this logic that would cleanly apply to all incoming invite events. Relies on https://github.com/element-hq/synapse/pull/17166 to fix linter errors.
* | Improve perf of sync device lists (#17216)Erik Johnston2024-05-215-62/+103
| | | | | | | | | | | | | | | | Re-introduces #17191, and includes #17197 and #17214 The basic idea is to stop calling `get_rooms_for_user` everywhere, and instead use the table `device_lists_changes_in_room`. Commits reviewable one-by-one.
* | Merge branch 'release-v1.108' into developErik Johnston2024-05-2127-25/+53
|\|
| * Fixup changelog v1.108.0rc1Erik Johnston2024-05-211-1/+1
| |
| * Fixup changelogErik Johnston2024-05-211-1/+1
| |
| * 1.108.0rc1Erik Johnston2024-05-2127-25/+53
| |
* | Bump twine from 5.0.0 to 5.1.0 (#17225)dependabot[bot]2024-05-211-3/+3
| |
* | Bump bcrypt from 4.1.2 to 4.1.3 (#17224)dependabot[bot]2024-05-211-28/+28
| |
* | Bump pyasn1 from 0.5.1 to 0.6.0 (#17223)dependabot[bot]2024-05-211-4/+4
| |
* | Bump types-psycopg2 from 2.9.21.20240311 to 2.9.21.20240417 (#17222)dependabot[bot]2024-05-211-3/+3
| |
* | Bump serde from 1.0.201 to 1.0.202 (#17221)dependabot[bot]2024-05-211-4/+4
| |
* | Bump anyhow from 1.0.83 to 1.0.86 (#17220)dependabot[bot]2024-05-211-2/+2
|/
* Add a short sleep if the request is rate-limited (#17210)Erik Johnston2024-05-186-4/+15
| | | This helps prevent clients from "tight-looping" retrying their request.
* Federated Knocking Endpoints added (missing in Docu) (#17058)Dominic Schubert2024-05-172-0/+3
|
* Refactor `SyncResultBuilder` assembly to its own function (#17202)Eric Eastwood2024-05-162-116/+149
| | | | | | 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
* Fix `joined_rooms`/`joined_room_ids` usage (#17208)Eric Eastwood2024-05-162-1/+2
| | | | | | | | 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.
* Rename to be obvious: `joined_rooms` -> `joined_room_ids` (#17203)Eric Eastwood2024-05-162-2/+3
| | | Split out from https://github.com/element-hq/synapse/pull/17167
* Removed `request_key` from the `SyncConfig` (moved outside as its own ↵Eric Eastwood2024-05-165-14/+59
| | | | | | | | | 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
* Route `/make_knock` and `/send_knock` to workers in Complement docker image ↵Andrew Morgan2024-05-162-0/+3
| | | | (#17195)
* Revert "Improve perf of sync device lists" (#17207)Erik Johnston2024-05-163-9/+46
| | | Reverts element-hq/synapse#17191
* Fix bug where push rules would be empty in `/sync` (#17142)Erik Johnston2024-05-163-13/+37
| | | | | | Fixes #16987 Some old accounts seem to have an entry in global account data table for push rules, which we should ignore
* Refactor Sync handler to be able to return different sync responses ↵Eric Eastwood2024-05-165-25/+128
| | | | | | | | | | | | | | (`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.
* Fix request path for `federation_whitelist_endpoint_enabled` option in ↵Andrew Morgan2024-05-152-1/+2
| | | | documentation (#17199)
* Merge branch 'master' into developAndrew Morgan2024-05-143-1/+13
|\
| * 1.107.0 v1.107.0 release-v1.107Andrew Morgan2024-05-143-1/+13
| |
* | Cache literal sync filter validation (#17186)Erik Johnston2024-05-142-1/+14
| | | | | | | | The sliding sync proxy (amongst other things) use literal json blobs as filters, and repeatedly validating them takes a bunch of CPU.
* | Reduce pauses on large device list changes (#17192)Erik Johnston2024-05-142-3/+11
| | | | | | | | For large accounts waking up all the relevant notifier streams can cause pauses of the reactor.
* | Improve perf of sync device lists (#17191)Erik Johnston2024-05-143-46/+9
| | | | | | | | | | 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.
* | Allows CAS SSO flow to provide user IDs composed of numbers only (#17098)Aurélien Grimpard2024-05-144-0/+30
| |
* | Bump serde_json from 1.0.116 to 1.0.117 (#17182)dependabot[bot]2024-05-141-2/+2
| |
* | Bump serde from 1.0.200 to 1.0.201 (#17183)dependabot[bot]2024-05-141-4/+4
| |
* | Bump gitpython from 3.1.41 to 3.1.43 (#17181)dependabot[bot]2024-05-141-4/+5
| |
* | Bump cryptography from 42.0.5 to 42.0.7 (#17180)dependabot[bot]2024-05-141-33/+33
| |
* | Bump immutabledict from 4.1.0 to 4.2.0 (#17179)dependabot[bot]2024-05-141-3/+3
| |
* | Bump sentry-sdk from 1.40.3 to 2.1.1 (#17178)dependabot[bot]2024-05-141-5/+21
| |
* | An federation whitelist query endpoint extension (#16848)Erik Johnston2024-05-138-0/+243
| | | | | | | | | | | | | | | | | | | | 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>
* | Actually fix public rooms (#17184)Erik Johnston2024-05-132-54/+55
| | | | | | | | | | See #17177. I'm an idiot and moved them to the wrong store :facepalm: