Commit Graph
1950 Commits
Author SHA1 Message Date
Paul ChobertandErik Johnston 15624be279 Profile endpoint rate limit (#20218)
This provides configurable (via `rc_profile`) rate limits for profile
endpoints:
- `GET /profile/{username}`
- `GET /profile/{username}/{keyName}` including (`displayname` &
`avatar_url`)

### 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: Erik Johnston <erik@matrix.org>
2026-09-18 12:00:45 +01:00
Andrew Morgan 88e5b6221d Update stale minimum poetry required in contributing docs (#20219) 2026-09-18 09:32:27 +00:00
Jason LittleandPaul Chobert 7530874a12 Raise default room version to "12" (#20130)
Requires
* #19768 
* #19782 
* https://github.com/matrix-org/complement/pull/915

To meet the requirements for bumping Synapse to support [Matrix spec to
1.16](https://github.com/element-hq/synapse/issues/19414) the default
room version should be incremented to "12".

Other than the two separate Synapse PRs above(which are included here
but marked as "[diverted]" and should be removed prior to review) there
is only [one other real
change](https://github.com/element-hq/synapse/commit/c005e96c665b5a098a9b95d10f33faf224564be9)
to the code base itself to fix a `KeyError` during logging for a `/sync`
test against unknown room versions. Everything else should be on the
unit tests themselves.

Standard unit test running applies, should be nothing special to test
this outright.
`poetry run trial -jN tests` and similar for Postgresql.

Probably ok to review commit-by-commit

I took the liberty of writing a [room creating
helper](https://github.com/element-hq/synapse/commit/5ba81ad5d4a0a6787b7626bdb3293f633ea4097a)
for the two test series that try and test the sharding of the
`event_persister` workers. I'm not certain it stands up to scrutiny, but
at least does not do any funny mocking when producing room v12
appropriate room IDs.

I also took the liberty of writing an [assertion
helper](https://github.com/element-hq/synapse/pull/20130/commits/e408cef241d1b9c6a88f069eb5832de053790f9b)
for comparing lists of dicts for a select subset of keys/values. This is
used to compare stripped state selections while waiting on
https://github.com/element-hq/synapse/pull/19723 to be completed.

### 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: Paul Chobert <paul@chobert.fr>
2026-09-17 18:32:51 +00:00
Haris 1d9aa4823a docs: add docs about firewall configuration (#20225)
### 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))

Replaces #20198 to remove git issues
2026-09-17 17:34:02 +00:00
Devon HudsonandClaude Sonnet 5 f7c16d0148 Support configuring a username for Redis connections (#20187)
Adds a `redis.username` config option.

Details:
A `username` without a `password` (or `password_path`) is refused at
startup. Redis has no wire form for a username without a password, and
txredisapi only sends `AUTH` when a password is set, so the username
would otherwise be silently ignored. An explicitly empty password is
accepted, since that is how a `nopass` ACL user is configured.

This relies on txredisapi 1.4.12, the first release to accept a
`username` kwarg. That upstream support was contributed by @karolyi
specifically to unblock this.

Fixes #19238.


### 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: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 17:16:47 +00:00
Andrew Morgan 177f8b5b76 Fix htmltest CI; put docs dependencies in pyproject.toml (#20216) 2026-09-15 10:58:08 +00:00
Andrew Morgan 46f3eb082e Fix warnings generated by mdbook build (#20217) 2026-09-11 13:15:39 +00:00
Ben Banfield-Zanin f7cd91f6b0 Document that the new get single delayed event endpoint is workerisable (#20210)
### Pull Request Checklist

Missed off of https://github.com/element-hq/synapse/pull/19926/changes
IMO. My reading of
https://github.com/element-hq/synapse/blob/v1.161.0rc1/synapse/rest/client/delayed_events.py
is that the new endpoint (pattern
`r"/org\.matrix\.msc4140/delayed_events/(?P<delay_id>[^/]+)$"` is
workerisable) given how `register_servlets` flows. However given
`UpdateDelayedEventServlet` covers the same pattern but for `POST`
requests, this should go in the `GET` only part of the documentation.

<!-- 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))
2026-09-10 16:25:24 +00:00
Ben Banfield-Zanin c69d7eeb59 Document MAS admin APIs as being workerisable (#20209)
### Pull Request Checklist

Replacement for https://github.com/element-hq/synapse/pull/19752 as that
has bit-rotted with https://github.com/element-hq/synapse/pull/19895
being merged.

`/_synapse/mas` is mounted on a worker on matrix.org and can be seen to
be workerisable via
*
https://github.com/element-hq/synapse/blob/v1.160.0/synapse/app/generic_worker.py#L202
*
https://github.com/element-hq/synapse/blob/v1.160.0/synapse/rest/synapse/client/__init__.py#L71
*
https://github.com/element-hq/synapse/blob/v1.160.0/synapse/rest/synapse/mas/__init__.py#L46-L71

<!-- 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))
2026-09-10 13:50:42 +01:00
dea059a94d Restrict message events from being redacted by local users if past allowed period. (#20138)
Closes: #20065 

---------

Co-authored-by: defaultdino <adve@adisve.net>
Co-authored-by: Olivier 'reivilibre <oliverw@element.io>
2026-09-02 16:36:35 +01:00
FrenchGithubUser c40ab6e3b9 Fix sending duplicate m.room.encryption events on room creation (#20106)
On room creation when the client already supplies one in the initial
state and `encryption_enabled_by_default_for_room_type` is enabled.
2026-09-02 15:52:41 +01:00
V02460 bf68c63605 Make federation_domain_whitelist nullable in config schema (#20140)
Aligns the config schema of `federation_domain_whitelist` more closely
with its semantics and its actual implementation in Synapse. This is
done by making it nullable.

- all behavior of the option is now achievable by setting the config
option to an actual value
- aligned behavior of the property between unset and null
- provide a definitive default value

This also fixes the formatting problem with separating the paragraphs in
the documentation.
2026-08-27 14:55:41 +01:00
Johannes MarbachandAndrew Morgan c246d81dec Add support for specifying the SFU WebSocket URL together with configured LiveKit transports (#20146)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-08-27 11:21:47 +00:00
4bb07152c8 Support for profile updates over Sliding Sync (MSC4262) (#20003)
This PR implements support for profile updates over Sliding Sync:
https://github.com/matrix-org/matrix-spec-proposals/pull/4262. This pr
may be easier to review as a whole than commit by commit.

This builds on the legacy sync profile updates feature
https://github.com/element-hq/synapse/pull/19556, specifically the
profile updates stream it added.

Submitting for early review to get consensus on implementation. There
are some things we would like to add still, from spec, mainly:

* > Homeservers should only consider a profile field update "accepted"
by a client
> once the client returns with a new /sync request with the next /sync
token,
> NOT just after sending down the profile update. The client may never
receive
> response due to network conditions, or a bug in the client
implementation.
* > When a room enters this subset in this connection for the first
time, all requested
> fields from profiles of users in that room MAY be sent down. This
gives the client
> a base set of information for which future field updates can be
applied on top of.
> The homeserver MAY omit some fields and profiles if it believes that
the client has
> already received them, likewise repeat profiles MAY be sent down based
on homeserver
  > implementation.
* > Finally, if the list of fields expands to cover a new field ID,
those fields should
> be sent down for all users that are within the current room subset.
Future incremental
  > updates will then include changes to this field.
* Additionally, we would need to implement a lazy loading cache similar
to the legacy sync. (not part of MSC as such)

Depending on review these could either be added to this pr, or to keep
this pr from not growing too much, be added in a follow-up pr, as they
are more enhancement to this base sliding sync profile updates
functionality than a part of the core functionality.

### 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: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Olivier 'reivilibre' <olivier@librepush.net>
Co-authored-by: Olivier 'reivilibre <oliverw@element.io>
2026-08-25 14:37:03 +00:00
Erik JohnstonandClaude Fable 5 0c6714d0d2 Allow specifying multiple action_name and status params in the scheduled tasks admin API (#20067)
We have an internal usage of `/scheduled_tasks` that would like to fetch
multiple actions at once (janitor).

We also make it so that invalid `status` values now return a 400 rather
than a 500.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 14:02:07 +01:00
Andrew Morgan b7db66c21e Clarify comment
From
https://github.com/element-hq/synapse/pull/19875#discussion_r3774386943.
I was unable to do so on the PR quickly as the branch was not available
for maintainers to edit.
2026-08-13 11:13:36 +01:00
William L Thomson Jr 4bbc6ad74f Document lighttpd configuration example from matrix.jaxlug.ngo (#19875) 2026-08-13 10:12:32 +00:00
Olivier 'reivilibre 9f1cf3f482 Fix the documentation on the federation_domain_whitelist config option. (#20089)
[As discussed in Backend
Lobby](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$jz87yx9uFcwKYhwejCLiVlfRLKseUHRnRrz2jZcGvOs?via=jki.re&via=element.io&via=matrix.org)

As for justification for calling this the recommended way,

- from memory this is accurate
- a previous changelog implies this:
https://github.com/element-hq/synapse/blob/287904c03ac8892407be960d475c4d25007e8917/docs/changelogs/CHANGES-2022.md?plain=1#L1296
- this is what we are doing internally ([Backend Lobby
example](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$MTCVg5-D0k_jq9QZxVSSy1CeMGs8mbG6ld-BWOOy9JI?via=jki.re&via=element.io&via=matrix.org))

I can't find a definitive source though

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-08-11 17:31:15 +01:00
Eric Eastwood 6585314746 Update stream cheatsheet docs to re-link synapse/config/workers.py with more references (#20086)
The [old
link](https://github.com/element-hq/synapse/blob/4367fb2d078c52959aeca0fe6874539c53e8360d/synapse/config/workers.py#L177)
only references `thread_subscriptions` once but in the latest state of
the code with the [new
link](https://github.com/element-hq/synapse/blob/62a4bc46203880dd5034483b0e84156d03a3a8c6/synapse/config/workers.py#L184-L187)
there are 5 places in the file to look at.

Spawning from seeing a few more changes in
https://github.com/element-hq/synapse/pull/20085 that were missed in
https://github.com/element-hq/synapse/pull/19558 and wondering why I
didn't notice before. In fact, some of this clean-up for
`thread_subscriptions` (the reference stream from the cheatsheet) wasn't
updated until recently (this week) as part of
https://github.com/element-hq/synapse/pull/19556
2026-08-11 10:27:02 -05:00
Olivier 'reivilibre d80a4e69da Dust off make_full_schema and add CI using it to show schema diffs. (#20027)
It seems a lot of time in our trial tests goes towards setting up the
database. (The same is probably true of Complement too)

We haven't done a full schema for about 20 schema versions, so no
surprise!

As a result, I want to produce a full schema soon.

In this PR I dust off `make_full_schema.sh` (which seems to have broken
after some SQLite changes)
and add a CI workflow that runs it (producing a diff) when someone
changes the schema.

The CI workflow also adds a sticky comment showing the diff on the
schema, so you can better appreciate the final effect of a change.

---

**Dead changes:**

I wanted to make it possible to generate a versioned full schema without
the manual work,
but you can't run the background updates without essentially starting up
a homeserver,
at which point it might fail because you haven't run all the deltas yet.

There's no actual good way to do this, short of deleting the latest
deltas (+ tweaking code to not crash without them)
or rolling back in the git history.

Backed out those changes, but they're preserved on the PR if interesting.

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-08-11 12:55:59 +01:00
Erik JohnstonandClaude Fable 5 62a4bc4620 Fix quarantined_media stream not being replicated (#20085)
The registration of `QuarantinedMediaStream` in
`ReplicationCommandHandler._streams_to_replicate` was missed when the
stream was added, so an instance configured as the
quarantined_media_changes stream writer never sent RDATA/POSITION for it
unless it was the main process.

Also add the stream to the `instance_map` config validation.

Stream was introduced in
https://github.com/element-hq/synapse/pull/19558

Fixes https://github.com/element-hq/synapse/issues/20080

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 15:47:01 +01:00
Eric Eastwood 0654c312db Add upgrade notes to point out updated Debian package signing key (2026) (#20066)
Part of https://github.com/element-hq/synapse/issues/20038

Language based on the previous time we did this: https://github.com/element-hq/synapse/blob/3cb6c3484daa59c56bbc3d8df295e011c9f0d2cf/docs/upgrade.md?plain=1#L415-L431
2026-08-07 15:30:49 -05:00
Hugh Nimmo-Smith f4cf7ab29e Clarify media upload limit callback triggers (#20018) 2026-08-07 17:44:06 +01:00
c5f02a9313 Introduce support for MSC4429: Profile Updates for Legacy Sync (#19556)
Implements support for [MSC4429: Profile Updates for Legacy
Sync](https://github.com/matrix-org/matrix-spec-proposals/pull/4429).

Paired with https://github.com/matrix-org/complement/pull/849 and
https://github.com/matrix-org/sytest/tree/anoa/msc4429

Tracking issue for removing unstable identifiers in Synapse:
https://github.com/element-hq/synapse/issues/19891
Further improvements tracked in:
https://github.com/element-hq/synapse/issues/19981

---------

Co-authored-by: Half-Shot <will@half-shot.uk>
Co-authored-by: Jason Robinson <jasonr@element.io>
Co-authored-by: Olivier 'reivilibre' <oliverw@element.io>
2026-08-06 15:35:07 +01:00
Eric Eastwood 2c8bf9a3ab Drop support for Ubuntu 25.10 'Questing Quokka', add support for Ubuntu 26.04 'Resolute Raccoon' (#20039)
Fix https://github.com/element-hq/synapse/issues/20031

### Dev notes

 - https://endoflife.date/ubuntu
 - https://endoflife.date/debian
 - https://endoflife.date/python

Finding Python version on distros:

 - https://packages.debian.org/trixie/python3
 - https://packages.ubuntu.com/resolute/python3
2026-08-04 09:08:19 -05:00
Olivier 'reivilibre 36664cac4f Add Module API hooks that notify modules when events are delivered over federation. (#20019)
Closes: https://github.com/element-hq/synapse/issues/19904

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-07-30 12:32:27 +01:00
Olivier 'reivilibre 9761f9bc42 Merge branch 'master' into develop 2026-07-28 14:39:05 +01:00
Olivier 'reivilibre 44216bf2b6 Limit the size of push rules
Fixes: https://github.com/element-hq/synapse/security/advisories/GHSA-fp53-rw9v-hcf9
Fixes: https://github.com/matrix-org/internal-config/issues/1071

Because this is an out-of-spec limit and could break someone's workflow on release day, I've opted to make it configurable.

-----

Reviewed-on: https://github.com/element-hq/synapse-private/pull/149
2026-07-28 13:58:06 +01:00
Hugh Nimmo-Smith 97fb38eca6 Return M_USER_LIMIT_EXCEEDED error code for media upload limits from MSC4335 (#18876)
This PR uses the new `M_USER_LIMIT_EXCEEDED` common error code instead
of the malformed `M_RESOURCE_LIMIT_EXCEEDED` error code (as reported by
#18749) (spec: MSC4335).

The error code is also changed from `400` to `403` as this matches what
is in the spec for the endpoints:
https://spec.matrix.org/v1.18/client-server-api/#post_matrixmediav3upload
and
https://spec.matrix.org/v1.18/client-server-api/#put_matrixmediav3uploadservernamemediaid
(albeit the latter says that `M_FORBIDDEN` would be returned)

By default a new built-in `media_upload_limit_exceeded.html` template
will be served for the `info_uri`. Administrators can specify an
external URI in config instead.

Compatibility is retained for any existing modules making use the
`MediaUploadLimit` (e.g. via the `get_media_upload_limits_for_user`
callback).
2026-07-24 16:39:04 -05:00
夜坂雅 5ed830b3b4 Change default room version to 11 (MSC4239) (#18680)
Fix #18530

Complement test changes: https://github.com/matrix-org/complement/pull/858

SyTest changes: https://github.com/matrix-org/sytest/pull/1422
2026-07-16 12:33:13 -05:00
jakobrss 243983e193 Clarified documentation for "List accounts" guests parameter (#19963) 2026-07-15 11:18:55 +00:00
Erik JohnstonandClaude Fable 5 0bd28389b1 Improve caching for presence (#19939)
This does two things, first it adds a config flag to ignore rooms for
the purposes of presence routing.

Secondly, it changes the caching behaviour to try and improve the cache
hit ratio. Previously, the size of the `do_users_share_a_room` cache
(which stores pairs of users) needs to `O(n²)` for the number of online
users, which is infeasible for large servers.

Instead, we call `get_users_in_room` for both the syncing and updated
users. This sounds more expensive, but a) we will already have cached
the syncing user's rooms, and b) we will only calculate the updated
user's rooms once (rather than once per syncing user).

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 09:34:07 +01:00
Erik JohnstonandClaude Fable 5 3f3edaf029 Make the presence state-machine timers configurable (#19942)
Adds `last_active_granularity`, `sync_online_timeout` and `idle_timeout`
options to the `presence` config section, controlling the previously
hard-coded `LAST_ACTIVE_GRANULARITY`, `SYNC_ONLINE_TIMEOUT` and
`IDLE_TIMER` constants (which remain as the defaults).

This is mainly useful on deployments that ratelimit how often syncs can
affect presence (`rc_presence`): the sync timeout must exceed the
ratelimit interval or users flap offline between syncs, so tuning down
presence traffic currently requires squeezing under the fixed 30s limit.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 17:21:50 +01:00
Olivier 'reivilibre 5df6d1be65 Remove legacy MSC3861 auth delegation support (#19895)
Modern 'MAS integration' (as we call it now) is, of course, preserved.

Fixes: #19549

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-07-02 12:25:11 +01:00
Vitaly PryakhinandOlivier 'reivilibre 2517db46b3 add before and after filter to redact user method (/_synapse/admin/v1/user/$user_id/redact) (#19802)
Closes #19441 

---------

Co-authored-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-07-01 17:28:22 +01:00
Olivier 'reivilibre 1c79397d7f Tweak wording of Rust crate dependency update policy. (#19829)
After looking into it, just a couple of things to pick a bone at in the
old wording,
which I thought could be clarified for when I next come to look at this
again.


- the claim that there's a fundamental difference; I'd argue there isn't
really, it's just by convention
  on some mainstream distros. So I have changed this to 'typically'
- statements that some distros fetch dependencies at build time
(probably does happen, but
traditional distros make a point of not doing this for the reasons you'd
expect).
- This was probably meant to be talking about Debian, but my observation
based on sample size of 3 is that some crates are packaged natively,
others are vendored in the respective application's source package (like
they do for us) and sometime they patch the bounds a bit

There could probably be room to talk about how distros vendoring
packages is a maintenance burden on them,
but I guess it's a bit moot as we would struggle to conform to wide
enough bounds to make everyone
happy (and anyway; I expect the distros that vendor packages have the
tooling to make this easy to
update and we do keep on top of security updates and release
frequently...)

---

Spawning from discussion in
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$VttYPPUevn2S_W_rrzg2ZOXWI6aKebk2ganTgrLEWUc?via=jki.re&via=element.io&via=matrix.org)

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-06-23 18:40:38 +01:00
Maximilian Bosch 1f0c2bc3e4 docs/config: make it explicit that auto_join_rooms can be used for invite-only rooms (#19660) 2026-06-22 08:57:10 +00:00
2487b31422 MSC4140: allow auth on management endpoints for delayed events (#19794)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-18 13:27:37 +00:00
Sami Olmari 8cd695a78a Add stable room summary endpoint in worker docs. (#19788)
---------

Signed-off-by: Sami Olmari <sami@olmari.fi>
2026-06-17 16:40:24 +01:00
Hugh Nimmo-Smith bfaca98e57 Fix admin API user endpoint documentation examples to use JSON booleans (#19847)
I noticed that the documentation doesn't match reality.

The values from the database are cast to bools at:

- https://github.com/element-hq/synapse/blob/ff034c1f623bc769f1f3bca801592dd42697ea66/synapse/storage/databases/main/registration.py#L424-L439
- https://github.com/element-hq/synapse/blob/ff034c1f623bc769f1f3bca801592dd42697ea66/synapse/storage/databases/main/__init__.py#L330-L344
2026-06-11 11:36:38 -05:00
Olivier 'reivilibre 7f45a1ce2e Document that the SQLite version included in Ubuntu LTS, aside from ESM-only versions, is included in our support policy. (#19823)
The reason for querying this support was wanting support for SQLite's JSON operators, which are currently not present in the SQLite version found in Ubuntu's oldest supported LTS.

The JSON operators were used in some of the sticky events work (related: #19452).

Our ruling was that we should support Ubuntu oldest LTS equally to Debian oldstable, so support the oldest of the two versions from those.

That makes some kind of sense as it would be difficult to do otherwise without dropping support for that version of Ubuntu altogether, given if we kept publishing packages intended for use with Postgres, there's a risk that an innocent sysadmin would update their SQLite deployment without realising that it is no longer supported.

This was [discussed months ago
(private)](https://docs.google.com/document/d/12RZKPk3a4__JUSH9wYHODo9rRyKzsHg6BSCAcmqmbOU/edit?tab=t.0#bookmark=id.fcdvoc88dy5s)
and at [private](https://docs.google.com/document/d/12RZKPk3a4__JUSH9wYHODo9rRyKzsHg6BSCAcmqmbOU/edit?tab=t.0#bookmark=id.u48ivjge4qpt).

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-06-05 16:36:18 +01:00
Eric Eastwood 9f2ce52361 Document how to see Rust build failure output when using poetry install (#19818)
Knowledge from @reivilibre in
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$2WUfCdA02wZw-6-jhw3QbLQ44BmKJrqLuZ6wjz2r7hk?via=jki.re&via=element.io&via=matrix.org)
on 2025-12-15.

Spawning from me making Rust changes but nothing useful was printed
until I added `-v`,

```shell
$ poetry install --extras all
Installing dependencies from lock file

Package operations: 0 installs, 1 update, 0 removals

  - Updating pyjwt (2.11.0 -> 2.12.0)

Installing the current project: matrix-synapse (1.154.0rc1)
Failed to install /home/eric/Documents/github/element/synapse
```

I also see `poetry run maturin develop` suggested but I'd prefer not to
need to install `maturin` as yet another system tool to manage myself.
2026-06-03 10:44:39 -05:00
shcherbakandAndrew Morgan 306d8b23bd Feat/gcp json formatter (#19775)
Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
2026-05-29 10:57:33 +00:00
mhlas7andMichael Hlas 0c6e0f79e5 doc: Enhance update_profile_information documentation with picture claim (#19508)
Added details how synapse syncs the picture claim when
update_profile_information setting is true. Addresses #17836

---------

Co-authored-by: Michael Hlas <3398654+mhlas7@users.noreply.github.com>
2026-05-15 15:29:53 +00:00
Noah Markert 2e7019ebc8 Expose tombstone status in room details (#19737)
Exposes `tombstoned` and `replacement_room` in room details on admin API
endpoint `GET /_synapse/admin/v1/rooms/<room_id>`. Resolves #18347
2026-04-30 13:37:40 +01:00
Eric Eastwood 22e1643359 Add warning about known problems when configuring use_frozen_dicts (#19711)
Known problems: https://github.com/element-hq/synapse/issues/18117

As a follow-up, we should consider removing this config option
altogether. It's "expensive" and claims to "prevent bugs" but actually
introduces a whole new class of bugs. It could be re-introduced with a
more holistic solution to the typing. Or a completely new approach (safe
mode that blows up when someone mutates the event content, always make
deep clones when handing out references, etc)

The `use_frozen_dict` config option was there [since
inception](https://github.com/element-hq/synapse/commit/a7b65bdedf512f646a3ca2478fb96a914856de35)
but was only recently
[documented](https://github.com/element-hq/synapse/pull/18122) for
completeness sake.
2026-04-24 12:00:13 -05:00
Eric Eastwood 67b4d8e7e3 Add docs for what to document about a new stream (#19696)
Spawning from the follow-up necessary when adding a new stream
(https://github.com/element-hq/synapse/pull/19694)
2026-04-17 09:50:37 -05:00
Travis RalstonandEric Eastwood e1b56313de Add upgrade notes for new quarantined_media_changes stream (#19694)
Fixes https://github.com/element-hq/synapse/issues/19692

Introduced by https://github.com/element-hq/synapse/pull/19558

---------

Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
2026-04-16 10:31:10 +00:00
Olivier 'reivilibre 943da0ace8 Fix database migrations failing on platforms where SQLite is configured with SQLITE_DBCONFIG_DEFENSIVE by default, such as macOS. (#19690)
Fixes: #19616

This caused 2+ people trouble now, so worth batting away with a
low-effort change if we can.

Only seen on macOS so far, but nothing stops SQLite being configured in
defensive mode by default on other platforms, so it is not necessarily
entirely specific to macOS.

We *could* also do this for Python < 3.12 but it'd be more effort and I
don't know if it's worth it.

(For context @kegsay says the interpreter with this problem was
installed through `pyenv install`.)

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-04-15 16:55:46 +01:00
bed00bb766 Allow resigning of events with a new signing key (#19668)
This adds a way to re-sign all locally-created events with a new signing
key, which is useful when rotating server signing keys.

This doesn't trigger automatically, instead needs to be triggered when
needed via the admin API.

c.f.
https://github.com/matrix-org/internal-config/issues/1670#issuecomment-4206020126
for internal discussion.

---------

Co-authored-by: Kegan Dougall <kegan@element.io>
Co-authored-by: Erik Johnston <erikj@element.io>
2026-04-14 16:44:58 +00:00