Commit Graph
26235 Commits
Author SHA1 Message Date
Devon Hudson 5d7facd388 Update changelog filename 2026-10-30 16:19:18 -06:00
Devon HudsonandClaude Opus 5.5 638943cb0e Include out-of-band leaves in initial /sync
An out-of-band leave, such as a remote invite rescinded by the inviter or
a rejected remote invite, is an outlier and so not in the room's
timeline. Incremental sync already sends it as the room's timeline, but
initial sync only loaded the timeline from the room stream, so it
dropped the room if the user had never been in it, and otherwise
returned the history without the leave.

Initial sync now loads the room's history before the out-of-band leave
and adds the leave at the end, including when the history has a gap.
When the timeline starts with the leave, the state at the end of the
timeline is used as the state at its start, as the leave has no state of
its own.

Rescinded invites are returned whether or not `include_leave` is set,
like any other room the user was kicked from, as incremental sync
already did.

This made Complement's `Inviter_user_can_rescind_invite_over_federation`
flaky: if the rescission reached the invitee's server before the test's
first sync, the leave was never returned.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-30 16:07:34 -06:00
dependabot[bot] cc172f7ac7 Bump tornado from 6.5.9 to 6.6 (#20437) 2026-10-30 15:47:50 -05:00
Johannes MarbachandDevon Hudson 1a5fec63e3 Remove duplicative early exit in sliding sync processing (#20431)
As suggested in
https://github.com/element-hq/synapse/pull/20363#discussion_r4406785188.

### 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: Devon Hudson <devon.dmytro@gmail.com>
2026-10-30 18:24:03 +00:00
Olivier 'reivilibre 0a88b4287e Fix MSC4354 Sticky Events that expired during sync processing being returned as expired events in the sticky section of the sync response. (#20349)
Part of: MSC4354 (Experimental Feature tracking issue #19409)

This is a bit of an edge case, but nonetheless good to handle.

The included regression tests failed before the fix.

- Fix sticky events that expired during sync processing being returned

  See discussion:

https://github.com/matrix-org/matrix-spec-proposals/pull/4354#discussion_r4209309068

  See MSC cautionary note:

https://github.com/matrix-org/matrix-spec-proposals/commit/9915d50437ac494efdd91244451f46fd1934168c

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-10-30 17:29:14 +00:00
Johannes Marbach 25492acda3 Stabilise MSC4143 (#20425)
This stabilizes the implementation of
https://github.com/matrix-org/matrix-spec-proposals/pull/4143 which
includes the following:

- Stable `/rtc/transports` as per
https://github.com/matrix-org/matrix-spec-proposals/pull/4143 and
https://github.com/matrix-org/matrix-spec-proposals/pull/4195. The
unstable endpoint is retained for backwards compatibility.
- Adding `m.rtc.slot` events to the state events retained during room
upgrades.

### 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))
2026-10-30 15:47:01 +00:00
Eric Eastwood ee91c5fff0 Add support for Ubuntu 26.10 'Stonking Stingray' (#20428)
Fix https://github.com/element-hq/synapse/issues/20040

Associated PR: https://github.com/matrix-org/pkg-repo-configs/pull/32

This PR was written following the instructions in Element's internal
handbook page for [adding a new
distribution](https://handbook.element.io/books/backend-team/page/synapse-debian-packages#bkmrk-adding-a-new-distrib).
2026-10-30 09:30:54 -05:00
Raphael Fakhri 56acc229a5 Return identity server errors from third-party invites instead of a 500 (#20401)
Fixes #19257.

When an identity server returns a non-2xx response to
`/_matrix/identity/v2/store-invite` during a third-party invite,
`ask_id_server_for_third_party_invite` lets the `HttpResponseException`
escape. The client receives a 500 `M_UNKNOWN` error and the real cause
(for example, `M_THREEPID_IN_USE`) is lost.

This change catches `HttpResponseException` and converts it with
`to_synapse_error()`, which matches how the other identity server calls
in `IdentityHandler` (bind, `requestToken`) already handle error
responses.

A new test in `ThreepidInviteTestCase` makes the identity server return
a 400 `M_THREEPID_IN_USE` error and checks that the client receives the
same code and errcode. The test fails on `develop` with `500 != 400` and
passes with this change.
2026-10-29 18:43:27 +00:00
Erik Johnston eca9a4acd3 Fix regression with lazy membership and concurrenet syncs (#20433)
Broke by #20289. Hopefully fixes element-hq/element-web#35567.

One subtle change in #20289 was that we started to filter rooms with
`full_state` set through the cache. This *should* be safe since none of
the membership events should have been previously sent down the sync.

However, there is a bug with the lazy-loaded member cache when two
concurrent syncs for the same device happens. The updates to the cache
from the handling of one request are immediately seen by the other
request, polluting the cache.

This is a relatively common scenario in Element Web when a user reloads
the page. The sync from before the reload is still being processed when
Synapse receives the initial sync from after the reload.

The full fix to correctly handle overlapping requests is a separate PR,
but this is a stop-gap measure that should help Element Web.
2026-10-29 16:06:13 +00:00
Olivier 'reivilibre b47432bb22 Slightly speed up the 'release artifacts' CI release steps. (#20397)
Small, easy, low-hanging suggestions when wondering how to speed up our
release process.

- CI: Use multithreading in tarball xz compression
It looks like this compression takes about ~2 minutes. If we use 4 cores
then maybe this will be ~30 seconds + nonlinearity overhead.

- CI: Use trial --jobs=6 instead of -j2 for debs
  Other than matching regular CI, this might take off 3~4 min.

Other than that, some caching for the release artifacts step and using
bigger runners to speed up the tests more might help, but those are more
invasive changes.

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-10-29 15:08:26 +00:00
Eric Eastwood ca28da9663 Merge branch 'master' into develop 2026-10-28 13:31:23 -05:00
Eric Eastwood 6295960ba7 Merge branch 'release-v1.164' 2026-10-28 13:31:17 -05:00
Paul Chobert 1bd2178a08 Add an index on lower(name) to users to speed up username availability checks (#20369)
Checking whether a username is available looks users up
case-insensitively, with `WHERE lower(name) = lower(?)`. But there is
currently no index on `lower(name)`, so each check scans the whole
table.

This backs registration, `GET /_synapse/admin/v1/username_available` and
`GET /_synapse/mas/is_localpart_available`, which Matrix Authentication
Service will call as the user types in its registration form
([Interactive feedback for username availability in the registration
form
(element-hq/matrix-authentication-service#5977)](https://github.com/element-hq/matrix-authentication-service/pull/5977)).

- Adds `users_lower_name` on `users (lower(name))`, built as a
background update, on both PostgreSQL and SQLite.
- matrix.org already has an index with this name and definition, created
by hand ([Postgres indexes differ on matrix.org
(matrix-org/synapse#11893)](https://github.com/matrix-org/synapse/issues/11893)).
The background update drops and rebuilds it concurrently rather than
adding a duplicate; lookups fall back to a table scan until the rebuild
finishes.

### Pull Request Checklist

* [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-10-28 19:22:21 +01:00
Eric Eastwood 167b7ea3bc 1.164.1 v1.164.1 2026-10-28 13:06:18 -05:00
Eric Eastwood f46bbb27f3 Restore pillow Python 3.11 split
See https://github.com/element-hq/synapse/pull/20399
2026-10-28 13:02:30 -05:00
dependabot[bot] 709a03f801 Bump msgpack from 1.2.1 to 1.2.4 (#20421) 2026-10-28 13:00:06 -05:00
Jason Robinson 2ff51d3c7f Partially revert "Reject setting null profile field values" (#20422)
As per https://github.com/element-hq/synapse/issues/20419 this change
broke Element Web clearing user status, which basically means the client
is stuck with any status, and users cannot set a new one.

EW should move to use DELETE to clear user status, but until then we
should ensure the feature is not broken on existing clients in the wild.

Should we set a clear deprecation time for rejecting nulls? There might
be other clients using profile fields and doing PUT to clear the field.


Discussed in
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$b7zid3lLGdFDC8pwy1IvSPv3zl9y1fXEpnnBte9vcQU?via=jki.re&via=element.io&via=matrix.org)
[[1]](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$jTEcHlDBIvKRAKtV-ESXabkPkLia9B7C4JQVkoOxzj0?via=jki.re&via=element.io&via=matrix.org)

Reverts a part of https://github.com/element-hq/synapse/pull/20153 by
only rejecting null fields when the profile update stream is configured
(ie user status requirement).

Future work to unrevert tracked by
https://github.com/element-hq/synapse/issues/20424
2026-10-28 12:56:29 -05:00
dependabot[bot] 80bc844b2b Bump msgpack from 1.2.1 to 1.2.4 (#20421) 2026-10-28 12:51:44 -05:00
Jason Robinson ee3fc37345 Partially revert "Reject setting null profile field values" (#20422)
As per https://github.com/element-hq/synapse/issues/20419 this change
broke Element Web clearing user status, which basically means the client
is stuck with any status, and users cannot set a new one.

EW should move to use DELETE to clear user status, but until then we
should ensure the feature is not broken on existing clients in the wild.

Should we set a clear deprecation time for rejecting nulls? There might
be other clients using profile fields and doing PUT to clear the field.


Discussed in
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$b7zid3lLGdFDC8pwy1IvSPv3zl9y1fXEpnnBte9vcQU?via=jki.re&via=element.io&via=matrix.org)
[[1]](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$jTEcHlDBIvKRAKtV-ESXabkPkLia9B7C4JQVkoOxzj0?via=jki.re&via=element.io&via=matrix.org)

Reverts a part of https://github.com/element-hq/synapse/pull/20153 by
only rejecting null fields when the profile update stream is configured
(ie user status requirement).

Future work to unrevert tracked by
https://github.com/element-hq/synapse/issues/20424
2026-10-28 11:34:02 -05:00
Eric Eastwood 17eaa432e5 Clarify that manhole uses SSH (not Telnet) (#20417)
Spawning from looking at a [security
advisory](https://github.com/element-hq/synapse/security/dependabot/241)
but it doesn't apply because we don't use Telnet. Updating our erroneous
Telnet references to make it more clear that it doesn't apply to us.

Relevant code showing that we initialize a *SSH* listener: https://github.com/element-hq/synapse/blob/bde63a807e81c1b1f36e983b9f1874011181a13d/synapse/util/manhole.py#L74-L117
2026-10-28 09:54:31 -05:00
Eric Eastwood f315f286d6 Spurious dirty Rust change after running lint script (#20418)
Spurious dirty Rust change after running `poetry run ./scripts-dev/lint.sh`

Left behind from https://github.com/element-hq/synapse/pull/19996
2026-10-28 09:53:08 -05:00
dependabot[bot]andDevon Hudson b20ae98cc5 Bump authlib from 1.6.12 to 1.9.1 (#20415)
Bumps [authlib](https://github.com/authlib/authlib) from 1.6.12 to
1.9.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/authlib/authlib/releases">authlib's
releases</a>.</em></p>
<blockquote>
<h2>v1.9.1</h2>
<p>Changelog: <a
href="https://docs.authlib.org/en/stable/upgrades/changelog.html#changelog-1-9-1">https://docs.authlib.org/en/stable/upgrades/changelog.html#changelog-1-9-1</a></p>
<h2>What's Changed</h2>
<ul>
<li>Use scriv to handle the changelog by <a
href="https://github.com/azmeuk"><code>@​azmeuk</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/954">authlib/authlib#954</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/authlib/authlib/compare/v1.9.0...v1.9.1">https://github.com/authlib/authlib/compare/v1.9.0...v1.9.1</a></p>
<h2>v1.9.0</h2>
<h2>What's Changed</h2>
<ul>
<li>feat: add Identity Assertion JWT Authorization Grant (ID-JAG) by <a
href="https://github.com/BinoyOza-okta"><code>@​BinoyOza-okta</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/898">authlib/authlib#898</a></li>
<li>Fix empty signatures validation in JWS JSON deserialization by <a
href="https://github.com/loporto"><code>@​loporto</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/938">authlib/authlib#938</a></li>
<li>fix(jose): reject boolean values for NumericDate claims by <a
href="https://github.com/cpruijsen"><code>@​cpruijsen</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/942">authlib/authlib#942</a></li>
<li>fix(client): avoid duplicated OAuth 1.0 parameters in signed
requests by <a
href="https://github.com/cpruijsen"><code>@​cpruijsen</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/943">authlib/authlib#943</a></li>
<li>OAuth2 token fetch crashes with JSONDecodeError instead of a
catchable error on rate-limit responses by <a
href="https://github.com/juneja-varun"><code>@​juneja-varun</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/929">authlib/authlib#929</a></li>
<li>docs: add i18n wrappers in conf.py and templates by <a
href="https://github.com/hwhsu1231"><code>@​hwhsu1231</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/901">authlib/authlib#901</a></li>
<li>fix(oauth): enforce JOSE key, scope, and audience validation by <a
href="https://github.com/lepture"><code>@​lepture</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/945">authlib/authlib#945</a></li>
<li>AsyncOpenIDMixin.parse_id_token: return None when id_token is
absent, matching the sync client by <a
href="https://github.com/ckarnell"><code>@​ckarnell</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/924">authlib/authlib#924</a></li>
<li>fix(oauth): enforce nonce and JAR request validation by <a
href="https://github.com/lepture"><code>@​lepture</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/949">authlib/authlib#949</a></li>
<li>fix(oauth): require client authentication for ID-JAG grants by <a
href="https://github.com/lepture"><code>@​lepture</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/955">authlib/authlib#955</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/BinoyOza-okta"><code>@​BinoyOza-okta</code></a>
made their first contribution in <a
href="https://redirect.github.com/authlib/authlib/pull/898">authlib/authlib#898</a></li>
<li><a href="https://github.com/loporto"><code>@​loporto</code></a> made
their first contribution in <a
href="https://redirect.github.com/authlib/authlib/pull/938">authlib/authlib#938</a></li>
<li><a href="https://github.com/cpruijsen"><code>@​cpruijsen</code></a>
made their first contribution in <a
href="https://redirect.github.com/authlib/authlib/pull/942">authlib/authlib#942</a></li>
<li><a
href="https://github.com/juneja-varun"><code>@​juneja-varun</code></a>
made their first contribution in <a
href="https://redirect.github.com/authlib/authlib/pull/929">authlib/authlib#929</a></li>
<li><a href="https://github.com/hwhsu1231"><code>@​hwhsu1231</code></a>
made their first contribution in <a
href="https://redirect.github.com/authlib/authlib/pull/901">authlib/authlib#901</a></li>
<li><a href="https://github.com/ckarnell"><code>@​ckarnell</code></a>
made their first contribution in <a
href="https://redirect.github.com/authlib/authlib/pull/924">authlib/authlib#924</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/authlib/authlib/compare/v1.8.0...v1.9.0">https://github.com/authlib/authlib/compare/v1.8.0...v1.9.0</a></p>
<h2>v1.8.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Prefer <code>id_token_signed_response_alg</code> client metadata to
guess algs by <a
href="https://github.com/azmeuk"><code>@​azmeuk</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/888">authlib/authlib#888</a></li>
<li>fix: Catch InvalidKeyIdError in RFC 9068 JWTBearerTokenValidator by
<a
href="https://github.com/liudonggalaxy"><code>@​liudonggalaxy</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/891">authlib/authlib#891</a></li>
<li>fix: make leeway configurable in JWTBearerTokenValidator by <a
href="https://github.com/mondi04"><code>@​mondi04</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/903">authlib/authlib#903</a></li>
<li>feat: add default jti claim to sign_jwt_bearer_assertion by <a
href="https://github.com/liudonggalaxy"><code>@​liudonggalaxy</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/897">authlib/authlib#897</a></li>
<li>fix(oauth): cast sub claim to string in JWTBearerTokenGenerator by
<a href="https://github.com/levinKaus"><code>@​levinKaus</code></a> in
<a
href="https://redirect.github.com/authlib/authlib/pull/911">authlib/authlib#911</a></li>
<li>Declare lower bounds for dependencies by <a
href="https://github.com/azmeuk"><code>@​azmeuk</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/912">authlib/authlib#912</a></li>
<li>feat(client): use httpx2 instead of httpx by <a
href="https://github.com/levinKaus"><code>@​levinKaus</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/909">authlib/authlib#909</a></li>
<li>Fix RFC7523 malformed claims handling by <a
href="https://github.com/azmeuk"><code>@​azmeuk</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/916">authlib/authlib#916</a></li>
<li>Fix httpx oauth1 binary form data by <a
href="https://github.com/shc261392"><code>@​shc261392</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/779">authlib/authlib#779</a></li>
<li>fix(starlette_client): remove default= keyword from config.get calls
by <a
href="https://github.com/aliaksei-protchanka"><code>@​aliaksei-protchanka</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/770">authlib/authlib#770</a></li>
<li>Added client_id parameter to AssertionClient by <a
href="https://github.com/vilmar-hillow"><code>@​vilmar-hillow</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/476">authlib/authlib#476</a></li>
<li>fix(oauth): save device credential with authenticated client id by
<a
href="https://github.com/arpitjain099"><code>@​arpitjain099</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/908">authlib/authlib#908</a></li>
<li>fix(oauth1): correct protocol name in InsecureTransportError
description by <a
href="https://github.com/RavSinghChandan"><code>@​RavSinghChandan</code></a>
in <a
href="https://redirect.github.com/authlib/authlib/pull/919">authlib/authlib#919</a></li>
<li>fix(client): client can be flexible with jwt's header by <a
href="https://github.com/lepture"><code>@​lepture</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/922">authlib/authlib#922</a></li>
<li>fix(oidc): omit claims when the value is None by <a
href="https://github.com/lepture"><code>@​lepture</code></a> in <a
href="https://redirect.github.com/authlib/authlib/pull/923">authlib/authlib#923</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/authlib/authlib/commit/46b94870d915ee77430da8fa2a358378d90b3a45"><code>46b9487</code></a>
chore: release 1.9.1</li>
<li><a
href="https://github.com/authlib/authlib/commit/abb3f49dd97b086ade807942957ffdf4949d9f30"><code>abb3f49</code></a>
docs: use the issuer identifier as ID-JAG audience and fix broken
links</li>
<li><a
href="https://github.com/authlib/authlib/commit/1bd2a313492ce0a4d0571c150730907aa3fc91ff"><code>1bd2a31</code></a>
Merge commit from fork</li>
<li><a
href="https://github.com/authlib/authlib/commit/311da11e41ae44fac570ac5224a45e0fec993939"><code>311da11</code></a>
docs: more detailed PKCE instructions</li>
<li><a
href="https://github.com/authlib/authlib/commit/873f72c0345a6fc9b303b2e686bab29cab90f4ac"><code>873f72c</code></a>
docs: rpinitiated instructions</li>
<li><a
href="https://github.com/authlib/authlib/commit/4ff30db442c70e29486e1982cb0ad37c037f5f4b"><code>4ff30db</code></a>
Merge commit from fork</li>
<li><a
href="https://github.com/authlib/authlib/commit/9a86ff3e54e3c87d419d425c105f03fd84f3fe39"><code>9a86ff3</code></a>
docs: rpinitiated sequence chart</li>
<li><a
href="https://github.com/authlib/authlib/commit/1c357571408cad6c9a3cc08ea6df96df5e4edaf7"><code>1c35757</code></a>
docs: RFC 9101 sequence chart</li>
<li><a
href="https://github.com/authlib/authlib/commit/a755e2869f07710a5077784d04807bbe9bfd8026"><code>a755e28</code></a>
docs: add a sequence diagram to the token introspection page</li>
<li><a
href="https://github.com/authlib/authlib/commit/1996c567ed325c5e328f3c00dc7452ff79a89bd2"><code>1996c56</code></a>
docs: PKCE flow chart illustration</li>
<li>Additional commits viewable in <a
href="https://github.com/authlib/authlib/compare/v1.6.12...v1.9.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=authlib&package-manager=pip&previous-version=1.6.12&new-version=1.9.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/element-hq/synapse/network/alerts).

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Devon Hudson <devonhudson@librem.one>
2026-10-27 21:58:13 +00:00
Eric Eastwood bde63a807e Merge branch 'master' into develop
Conflicts:
	CHANGES.md
	debian/changelog
	pyproject.toml
2026-10-27 11:28:02 -05:00
Eric Eastwood 73c6acadca Merge branch 'release-v1.164'
Conflicts:
	CHANGES.md
	debian/changelog
	pyproject.toml
2026-10-27 11:27:20 -05:00
Eric Eastwood 1b76ddc6cb 1.164.0 v1.164.0 2026-10-27 11:03:25 -05:00
Eric Eastwood 5676ce4ab9 Remove tox.ini (#20410)
As far as I can tell, no one uses it. @reivilibre also asked this in
[`#synapse-dev:matrix.org`](https://matrix.to/#/!i5D5LLct_DYG-4hQprLzrxdbZ580U9UB6AEgFnk6rZQ/$NrW3QmLEGgcjNqW-SaPZrS-EVwq1-9fO_Ds_1QIZX0E?via=element.io&via=matrix.org&via=starstruck.systems)
and
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$_rh3S79z4q1Q93SJ3ncQ_ZUzudks4Egan5dwutH2AKg?via=jki.re&via=element.io&via=matrix.org)
on 2026-02-20 with a couple of 🔥 emoji reactions in the public
channel.

As long as I've worked on Synapse, as far as I know, I've never used
this for local dev.

We no longer use this in CI.

Noticed the file again while working on
https://github.com/element-hq/synapse/pull/20359
2026-10-27 09:34:38 -05:00
Eric Eastwood 4cece59c30 Drop support for Python 3.10 (#20359)
Fix https://github.com/element-hq/synapse/issues/20041

Keywords:

 - `3.10`
 - `py310`
 - `cp310`
2026-10-26 16:26:19 -05:00
Andrew MorganandPaul Chobert b27615282d [Server Announcements] [Create/Configure Rooms] Configure announcement rooms and reconcile them on startup (#20372)
Co-authored-by: Paul Chobert <paul@chobert.fr>
2026-10-26 17:20:04 +00:00
Johannes MarbachandOlivier 'reivilibre 0d28e93a7a Move the sticky events sliding sync extension to the global pos and MSC4508 scoping (#20363)
This includes the following:
    
- Implements ['Implicit Forward
Pagination'](https://github.com/matrix-org/matrix-spec/issues/2378).
Remove the extension's `since` and `next_batch` fields. The position is
now tracked via the global `pos`, with per-room connection state
recording how far each room has been sent so that `limit` paginates
without holding `pos` back and lost responses are re-delivered.
- Discussed in
https://github.com/matrix-org/matrix-spec-proposals/pull/4480#discussion_r4165887827
- Honour the `lists` and `rooms` fields.
- Send all unexpired sticky events when a room enters scope for the
first time or is newly joined, and catch up on events sent while a room
was out of scope when it re-enters.
- Enabling the extension partway through a connection returns all
unexpired sticky events for in-scope rooms, and re-enabling it after
disabling it returns the unexpired sticky events sent in the meantime.

I tried to split this up into standalone commits though the bulk of the
change is in the third commit.

---------

Co-authored-by: Olivier 'reivilibre <git.oo@emunest.net>
2026-10-26 14:02:22 +00:00
Hugh Nimmo-Smith d99e5fe783 Implement transaction IDs for MSC4388 and other updates (sign-in with QR code) (#19906) 2026-10-26 11:56:06 +00:00
Eric Eastwood 8d60450b33 Merge branch 'release-v1.164' into develop
Conflicts:
	CHANGES.md
	debian/changelog
2026-10-23 15:19:03 -05:00
Eric Eastwood aac366053f Merge branch 'master' into develop
Conflicts:
	pyproject.toml
2026-10-23 15:15:08 -05:00
Eric Eastwood 82c253f825 Clarify pillow bump only installable with Python >= 3.11 2026-10-23 15:01:53 -05:00
Eric Eastwood bcbf26641b Clarify pillow bump only installable with Python >= 3.11 2026-10-23 15:00:47 -05:00
Eric Eastwood 0a32d04b11 1.164.0rc3 v1.164.0rc3 2026-10-23 14:54:35 -05:00
Eric Eastwood 414abb9267 Bump pillow to version 13.0.0 with security fixes where Python support allows - Synapse 1.164.x (#20399)
The problem is that while `pillow@12.3.0` supports Python >= 3.10,
`pillow@13.0.0` only supports Python > 3.11, and we haven't dropped
support for Python 3.10 yet (tracked by
https://github.com/element-hq/synapse/issues/20041).

`pillow@13.0.0` includes some important security fixes:
https://pillow.readthedocs.io/en/stable/releasenotes/13.0.0.html

### How was this change made?

 1. `poetry update pillow`
1. Manually change the `"pillow"` `markers` in `poetry.lock` to split at
Python 3.11 instead of 3.14

Please note this is not a durable change. `poetry` will try to revert
this any time we try to make a change (requires diligence to make sure
we keep changing it back).

This maintenance burden will disappear once we drop Python 3.10 support
(tracked by https://github.com/element-hq/synapse/issues/20041).

### Alternatives

If we were up for updating the minimum version of `pillow` in
`pyproject.toml`, we could do something like the following which would
resolve in `poetry.lock` durably how we want,

`pyproject.toml`
```
    # Pillow 13 dropped Python 3.10 but has security fixes. Split so 3.11+ can pick up
    # the security fixes.
    #
    # FIXME: Remove the split once we drop Python 3.10 support.
    "Pillow>=10.0.1,<13; python_version < '3.11'",
    "Pillow>=13.0.0; python_version >= '3.11'",
```

It looks like we [previously
bumped](https://github.com/element-hq/synapse/blob/4853cd4238e100183fd7b0852ddf3e8eef894658/pyproject.toml#L54-L56)
the minimum version of `Pillow` for another CVE
(https://github.com/matrix-org/synapse/pull/16347)

Although, I'm guessing we'd rather leave the minimum version alone and
only update `poetry.lock`.

I think the problem with updating the minimum is that the packagers for
Linux distros will have to deal with not having the latest `pillow`
version available and may patch `pillow` a different way.
2026-10-23 14:52:14 -05:00
Eric Eastwood 62a411da7e 1.163.2 v1.163.2 2026-10-23 14:50:01 -05:00
Eric Eastwood f8a70f5424 Bump pillow to version 13.0.0 with security fixes where Python support allows (#20398)
The problem is that while `pillow@12.3.0` supports Python >= 3.10,
`pillow@13.0.0` only supports Python > 3.11, and we haven't dropped
support for Python 3.10 yet (tracked by
https://github.com/element-hq/synapse/issues/20041).

`pillow@13.0.0` includes some important security fixes:
https://pillow.readthedocs.io/en/stable/releasenotes/13.0.0.html

### How was this change made?

 1. `poetry update pillow`
1. Manually change the `"pillow"` `markers` in `poetry.lock` to split at
Python 3.11 instead of 3.14

Please note this is not a durable change. `poetry` will try to revert
this any time we try to make a change (requires diligence to make sure
we keep changing it back).

This maintenance burden will disappear once we drop Python 3.10 support
(tracked by https://github.com/element-hq/synapse/issues/20041).

### Alternatives

If we were up for updating the minimum version of `pillow` in
`pyproject.toml`, we could do something like the following which would
resolve in `poetry.lock` durably how we want,

`pyproject.toml`
```
    # Pillow 13 dropped Python 3.10 but has security fixes. Split so 3.11+ can pick up
    # the security fixes.
    #
    # FIXME: Remove the split once we drop Python 3.10 support.
    "Pillow>=10.0.1,<13; python_version < '3.11'",
    "Pillow>=13.0.0; python_version >= '3.11'",
```

It looks like we [previously
bumped](https://github.com/element-hq/synapse/blob/4853cd4238e100183fd7b0852ddf3e8eef894658/pyproject.toml#L54-L56)
the minimum version of `Pillow` for another CVE
(https://github.com/matrix-org/synapse/pull/16347)

Although, I'm guessing we'd rather leave the minimum version alone and
only update `poetry.lock`.

I think the problem with updating the minimum is that the packagers for
Linux distros will have to deal with not having the latest `pillow`
version available and may patch `pillow` a different way.
2026-10-23 14:48:11 -05:00
Junker der Provinz 4853cd4238 Remove $server_port from the Host header in the nginx reverse proxy example (#20391)
Fixes #19583

The nginx example in `docs/reverse_proxy.md` sets `proxy_set_header Host
$host:$server_port;`. The server block listens on 443, so nginx sends
`Host: matrix.example.com:443`. With `public_baseurl:
https://matrix.example.com/`, the request URI never starts with
`public_baseurl`, and `SsoRedirectServlet` keeps redirecting to itself.
That breaks SSO even when the internal and external ports are the same.
The line came in with #17994.

This switches the example to `proxy_set_header Host $host;`, as
@anoadragon453 recommended in #18359. I added a short comment for setups
where clients use a non-default port: use `$http_host` and put that port
in `public_baseurl`. The setup in #18359 (external port 50080) needs
that variant.

I left `docker/conf-workers/nginx.conf.j2` alone. Its listener port
matches `public_baseurl`, so `$host:$server_port` is right there.

This is a docs-only change, so there are no tests.

Thanks to @shibotto for reporting this and for pointing at the fix.

### 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))
2026-10-23 17:19:34 +00:00
Eric Eastwood 7ea942a5fe Merge branch 'release-v1.164' into develop
Conflicts:
	CHANGES.md
	debian/changelog
2026-10-22 14:51:16 -05:00
Eric Eastwood 06a1c55e56 1.164.0rc2 v1.164.0rc2 2026-10-22 14:32:23 -05:00
Eric Eastwood 2d7cccc87a Merge branch 'release-v1.164' of github.com:element-hq/synapse into release-v1.164 2026-10-22 14:30:33 -05:00
Eric Eastwood 603fb5bb39 Merge branch 'master' into develop
Conflicts:
	CHANGES.md
	debian/changelog
	pyproject.toml
2026-10-22 14:28:08 -05:00
Eric Eastwood b4daaca31f Update rustls-webpki to distrust eMudhra Intermediate certificates (#20392)
`rustls-webpki` releasenotes: https://github.com/rustls/webpki/releases/tag/v%2F0.103.16

Part of https://github.com/element-hq/backend-internal/issues/306

Related to https://github.com/element-hq/synapse/pull/20387

We already use the system CA store when making requests in our Rust code
(using the
[`rustls-tls-native-roots`](https://github.com/element-hq/synapse/blob/7c85c80033ea5c3ca3851f3dab1d0397b94d5183/rust/Cargo.toml#L61)
([docs](https://docs.rs/reqwest/0.12.28/reqwest/#optional-features))
feature with `reqwest`). For a system that already has a patched system
CA store, bumping `rustls-webpki` is simply extra protection as it
actively blocks those untrusted certs. For an unpatched system CA store,
this provides a stop-gap.


### Dev notes

```shell
$ cargo tree --invert rustls-webpki
rustls-webpki v0.103.16
└── rustls v0.23.45
    ├── hyper-rustls v0.27.7
    │   └── reqwest v0.12.28
    │       └── synapse v0.1.0 (/home/eric/Documents/github/element/synapse/rust)
    ├── reqwest v0.12.28 (*)
    └── tokio-rustls v0.26.2
        ├── hyper-rustls v0.27.7 (*)
        └── reqwest v0.12.28 (*)
```
2026-10-22 14:13:24 -05:00
Bardi Harborow c4680b6b81 security: update certifi to 2026.10.19 (#20387)
Updates `certifi` to 2026.10.19 to address
[GHSA-6q48-6c7w-9gw2](https://github.com/advisories/GHSA-6q48-6c7w-9gw2).

certifi before 2026.10.19 bundles `emSign ECC Root CA - G3`, which
chains to the compromised eMudhra intermediate CAs.

This only affects TLS connections made by the Sentry SDK when `sentry`
is configured, as `sentry_sdk`'s transport is the only runtime user of
certifi. Federation and Synapse's other outbound HTTP requests use the
system trust store via `platformTrust()`.

Python advisory:
https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576

---------

Signed-off-by: Bardi Harborow <bardi@bardiharborow.com>
2026-10-22 14:13:24 -05:00
Eric Eastwood 56913c3d71 1.163.1 v1.163.1 2026-10-22 14:01:36 -05:00
Eric Eastwood 3f2bef9429 Update rustls-webpki to distrust eMudhra Intermediate certificates (#20392)
`rustls-webpki` releasenotes: https://github.com/rustls/webpki/releases/tag/v%2F0.103.16

Part of https://github.com/element-hq/backend-internal/issues/306

Related to https://github.com/element-hq/synapse/pull/20387

We already use the system CA store when making requests in our Rust code
(using the
[`rustls-tls-native-roots`](https://github.com/element-hq/synapse/blob/7c85c80033ea5c3ca3851f3dab1d0397b94d5183/rust/Cargo.toml#L61)
([docs](https://docs.rs/reqwest/0.12.28/reqwest/#optional-features))
feature with `reqwest`). For a system that already has a patched system
CA store, bumping `rustls-webpki` is simply extra protection as it
actively blocks those untrusted certs. For an unpatched system CA store,
this provides a stop-gap.


### Dev notes

```shell
$ cargo tree --invert rustls-webpki
rustls-webpki v0.103.16
└── rustls v0.23.45
    ├── hyper-rustls v0.27.7
    │   └── reqwest v0.12.28
    │       └── synapse v0.1.0 (/home/eric/Documents/github/element/synapse/rust)
    ├── reqwest v0.12.28 (*)
    └── tokio-rustls v0.26.2
        ├── hyper-rustls v0.27.7 (*)
        └── reqwest v0.12.28 (*)
```
2026-10-22 13:50:51 -05:00
Bardi Harborow c3adef6578 security: update certifi to 2026.10.19 (#20387)
Updates `certifi` to 2026.10.19 to address
[GHSA-6q48-6c7w-9gw2](https://github.com/advisories/GHSA-6q48-6c7w-9gw2).

certifi before 2026.10.19 bundles `emSign ECC Root CA - G3`, which
chains to the compromised eMudhra intermediate CAs.

This only affects TLS connections made by the Sentry SDK when `sentry`
is configured, as `sentry_sdk`'s transport is the only runtime user of
certifi. Federation and Synapse's other outbound HTTP requests use the
system trust store via `platformTrust()`.

Python advisory:
https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576

---------

Signed-off-by: Bardi Harborow <bardi@bardiharborow.com>
2026-10-22 13:50:51 -05:00
Eric Eastwood 3366ea72cf Update rustls-webpki to distrust eMudhra Intermediate certificates (#20392)
`rustls-webpki` releasenotes: https://github.com/rustls/webpki/releases/tag/v%2F0.103.16

Part of https://github.com/element-hq/backend-internal/issues/306

Related to https://github.com/element-hq/synapse/pull/20387

We already use the system CA store when making requests in our Rust code
(using the
[`rustls-tls-native-roots`](https://github.com/element-hq/synapse/blob/7c85c80033ea5c3ca3851f3dab1d0397b94d5183/rust/Cargo.toml#L61)
([docs](https://docs.rs/reqwest/0.12.28/reqwest/#optional-features))
feature with `reqwest`). For a system that already has a patched system
CA store, bumping `rustls-webpki` is simply extra protection as it
actively blocks those untrusted certs. For an unpatched system CA store,
this provides a stop-gap.


### Dev notes

```shell
$ cargo tree --invert rustls-webpki
rustls-webpki v0.103.16
└── rustls v0.23.45
    ├── hyper-rustls v0.27.7
    │   └── reqwest v0.12.28
    │       └── synapse v0.1.0 (/home/eric/Documents/github/element/synapse/rust)
    ├── reqwest v0.12.28 (*)
    └── tokio-rustls v0.26.2
        ├── hyper-rustls v0.27.7 (*)
        └── reqwest v0.12.28 (*)
```
2026-10-22 09:49:50 -05:00
Johannes Marbach c54fd437e3 Switch the RTC notification rules to event-property-is (#20366)
As suggested in
https://github.com/matrix-org/matrix-spec-proposals/pull/4075#discussion_r4288130493.
2026-10-22 13:13:46 +01:00