Commit Graph
26222 Commits
Author SHA1 Message Date
Paul Chobert dddc0c99fe Keep server announcement history readable once the room is unconfigured 2026-10-29 23:15:50 +01:00
Paul Chobert c0f1b5ef9e Test reading server announcement history once the room is unconfigured 2026-10-29 23:15:49 +01:00
Paul Chobert 2b5c81e80f Explain the removed sender test setup 2026-10-29 23:05:55 +01:00
Paul Chobert a65d4b1981 Rename reader test parameter to reader_type 2026-10-29 22:51:23 +01:00
Paul Chobert 60b69469d8 Add changelog entry 2026-10-28 11:15:33 +01:00
Paul Chobert 2ee7b32a0b Let removed senders read server announcement history
A user who left a configured server announcement room, such as a sender
removed from its config, is now treated like a user who has never been
in it. Since the room is world-readable, they read its current history
and state instead of the room as it was when they left.

Add the server announcements store to workers, which now look rooms up
in it when checking room access.
2026-10-28 11:06:16 +01:00
Paul Chobert aa994e6b37 Test reading server announcement history as a removed sender
Run the history tests for a former announcement sender who was removed
from the room before the announcement was sent. /messages and
/rooms/{roomId}/initialSync fail for them: their leave membership limits
what they can read to the room as it was when they left.
2026-10-28 11:06:16 +01:00
Paul Chobert 49ab0792bf Test reading server announcement history outside of /sync
A local user who has never been in an announcement room can read it
through /messages, /context, /event, /relations, /threads and
/rooms/{roomId}/initialSync, because the room is world-readable.
2026-10-28 11:06:16 +01: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
Bardi Harborow 87b082f23a 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-21 19:29:23 -05:00
Olivier 'reivilibre 7c85c80033 Unbreak CI by bumping locked dependencies to support Python 3.15 wheels. (#20386)
It looks like our CI is sometimes being run with Python 3.15, where
`rpds-py` doesn't have wheels for our current version.

Unsure why it's intermittent.

Run:
https://github.com/element-hq/synapse/actions/runs/39464528041/job/118772376619

```
      | error: failed to run custom build command for `pyo3-ffi v0.27.2`
      | 
      | Caused by:
      |   process didn't exit successfully: `/tmp/tmp72_cy3_y/rpds_py-0.30.0/target/release/build/pyo3-ffi-ae84d9db989de8cd/build-script-build` (exit status: 1)
      |   --- stdout
      |   cargo:rustc-check-cfg=cfg(Py_LIMITED_API)
      |   cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)
      |   cargo:rustc-check-cfg=cfg(PyPy)
      |   cargo:rustc-check-cfg=cfg(GraalPy)
      |   cargo:rustc-check-cfg=cfg(py_sys_config, values("Py_DEBUG", "Py_REF_DEBUG", "Py_TRACE_REFS", "COUNT_ALLOCS"))
      |   cargo:rustc-check-cfg=cfg(pyo3_disable_reference_pool)
      |   cargo:rustc-check-cfg=cfg(pyo3_leak_on_drop_without_reference_pool)
      |   cargo:rustc-check-cfg=cfg(Py_3_7)
      |   cargo:rustc-check-cfg=cfg(Py_3_8)
      |   cargo:rustc-check-cfg=cfg(Py_3_9)
      |   cargo:rustc-check-cfg=cfg(Py_3_10)
      |   cargo:rustc-check-cfg=cfg(Py_3_11)
      |   cargo:rustc-check-cfg=cfg(Py_3_12)
      |   cargo:rustc-check-cfg=cfg(Py_3_13)
      |   cargo:rustc-check-cfg=cfg(Py_3_14)
      |   cargo:rustc-check-cfg=cfg(Py_3_15)
      |   cargo:rerun-if-env-changed=PYO3_CROSS
      |   cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
      |   cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
      |   cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
      |   cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
      |   cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY
      | 
      |   --- stderr
      |   error: the configured Python version (3.15) is newer than PyO3's maximum supported version (3.14)
      |   = help: this package is being built with PyO3 version 0.27.2
      |   = help: check https://crates.io/crates/pyo3 for the latest PyO3 version available
      |   = help: updating this package to the latest version of PyO3 may provide compatibility with this Python version
      |   = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      | warning: build failed, waiting for other jobs to finish...
      | 💥 maturin failed
      |   Caused by: Failed to build a native library through cargo
      |   Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_BUILD_EXTENSION_MODULE="1" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.15-64bit" PYO3_PYTHON="/tmp/tmpy90bal2g/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/tmp/tmpy90bal2g/.venv/bin/python" "cargo" "rustc" "--profile" "release" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/tmp72_cy3_y/rpds_py-0.30.0/Cargo.toml" "--lib"`
      | Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/tmpy90bal2g/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
  
  Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with rpds-py (0.30.0)
  
    - not supporting PEP 517 builds
    - not specifying PEP 517 build requirements correctly
    - the build requirements are incompatible with your operating system or Python version
    - the build requirements are missing system dependencies (eg: compilers, libraries, headers).
  
  You can verify this by running pip wheel --no-cache-dir --use-pep517 "rpds-py (==0.30.0)".
  
  
  PEP517 build of a dependency failed
```


```
      | error: failed to run custom build command for `pyo3-ffi v0.26.0`
      | 
      | Caused by:
      |   process didn't exit successfully: `/tmp/tmpy_lu888j/pydantic_core-2.41.5/target/release/build/pyo3-ffi-83252c0f9cb4430a/build-script-build` (exit status: 1)
      |   --- stdout
      |   cargo:rustc-check-cfg=cfg(Py_LIMITED_API)
      |   cargo:rustc-check-cfg=cfg(Py_GIL_DISABLED)
      |   cargo:rustc-check-cfg=cfg(PyPy)
      |   cargo:rustc-check-cfg=cfg(GraalPy)
      |   cargo:rustc-check-cfg=cfg(py_sys_config, values("Py_DEBUG", "Py_REF_DEBUG", "Py_TRACE_REFS", "COUNT_ALLOCS"))
      |   cargo:rustc-check-cfg=cfg(pyo3_disable_reference_pool)
      |   cargo:rustc-check-cfg=cfg(pyo3_leak_on_drop_without_reference_pool)
      |   cargo:rustc-check-cfg=cfg(Py_3_7)
      |   cargo:rustc-check-cfg=cfg(Py_3_8)
      |   cargo:rustc-check-cfg=cfg(Py_3_9)
      |   cargo:rustc-check-cfg=cfg(Py_3_10)
      |   cargo:rustc-check-cfg=cfg(Py_3_11)
      |   cargo:rustc-check-cfg=cfg(Py_3_12)
      |   cargo:rustc-check-cfg=cfg(Py_3_13)
      |   cargo:rustc-check-cfg=cfg(Py_3_14)
      |   cargo:rustc-check-cfg=cfg(Py_3_15)
      |   cargo:rerun-if-env-changed=PYO3_CROSS
      |   cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
      |   cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
      |   cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
      |   cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
      |   cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY
      | 
      |   --- stderr
      |   error: the configured Python interpreter version (3.15) is newer than PyO3's maximum supported version (3.14)
      |   = help: please check if an updated version of PyO3 is available. Current version: 0.26.0
      |   = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      | warning: build failed, waiting for other jobs to finish...
      | 💥 maturin failed
      |   Caused by: Failed to build a native library through cargo
      |   Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_BUILD_EXTENSION_MODULE="1" PYO3_ENVIRONMENT_SIGNATURE="cpython-3.15-64bit" PYO3_PYTHON="/tmp/tmprci5om5_/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/tmp/tmprci5om5_/.venv/bin/python" "cargo" "rustc" "--profile" "release" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/tmpy_lu888j/pydantic_core-2.41.5/Cargo.toml" "--lib" "--crate-type" "cdylib"`
      | Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/tmprci5om5_/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
  
  Note: This error originates from the build backend, and is likely not a problem with poetry but one of the following issues with pydantic-core (2.41.5)
  
    - not supporting PEP 517 builds
    - not specifying PEP 517 build requirements correctly
    - the build requirements are incompatible with your operating system or Python version
    - the build requirements are missing system dependencies (eg: compilers, libraries, headers).
  
  You can verify this by running pip wheel --no-cache-dir --use-pep517 "pydantic-core (==2.41.5)".
```

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-10-21 10:51:49 -05:00
Eric Eastwood 80d50913d6 Organize MSC4354 bugfixes with the others v1.164.0rc1 2026-10-20 09:54:17 -05:00
Eric Eastwood 7a7d81ce42 Link MSC4452 2026-10-20 09:51:46 -05:00
Eric Eastwood d053b37090 Lift new spec version advertisement to the top 2026-10-20 09:50:44 -05:00
Eric Eastwood 2e10fad626 We have enough context from the changelog entry for what MSC4140 is 2026-10-20 09:49:50 -05:00
Eric Eastwood 5df875ae67 Organize MSC4140 things together 2026-10-20 09:48:46 -05:00
Eric Eastwood d38f232372 Link MSC 2026-10-20 09:47:52 -05:00
Eric Eastwood 72c6a2cfb9 1.164.0rc1 2026-10-20 09:47:13 -05:00
Eric Eastwood 7d2e61abbb Correct docs for /redact_status failed_redactions/error (#20380)
Spawning from looking at these docs while looking at this area in
https://github.com/element-hq/synapse/pull/20379
2026-10-19 14:45:46 -05:00
Eric Eastwood cf306fbef6 Fix complete typo in redaction status admin API docs (#20379)
Fix https://github.com/element-hq/synapse/issues/18338
2026-10-19 12:09:02 -05:00
Erik Johnston eff0ecb062 Rust Postgres backend: value mapping and blocking runtime helpers (#19996)
Lays the two foundations the Rust DBAPI2 backend needs before any
connection code: a Python↔Postgres value-mapping layer, and the helpers
that drive async work from sync Python.

  Value mapping:
- `PgValue` — enum that implements `tokio_postgres::types::ToSql`,
encoding into Postgres' binary wire format per the prepared-statement
column type (so a single Python `int` becomes INT2/INT4/INT8 with range
checks).
- `PythonPgFromSql` — the decode counterpart, turning wire bytes back
into Python objects (SQL NULL → `None`).
- Covers int / float / bool / str / bytes / None; lists etc are left to
a follow-up.

  Blocking helpers:

- `block_on` / `block_on_pg_result` / `block_on_next` drive
`tokio-postgres` futures to completion from sync, GIL-holding Python
methods, releasing the GIL for the wait.

Both modules are `pub` for now so not-yet-consumed items don't trip
clippy's `dead_code` lint; later PRs in the stack tighten visibility.
Everything here is unit-tested with no live Postgres server.
2026-10-19 14:16:40 +01:00
7d44c81d5c Fix new state saved with the last local user's leave missing from state_after (#20314)
> [!NOTE]
> This PR will be rebased on `develop` once
https://github.com/element-hq/synapse/pull/20081 is merged

This PR is a follow up to
https://github.com/element-hq/synapse/pull/20081 and is based on its
code.
The scope of that original PR is limited to recovering the leave event
missing from `state_after`.

I noticed that state events from the leave event batch would only be
recovered if they were previously defined.

That made me add a pre-condition to the test: the topic had to be set
first.


https://github.com/element-hq/synapse/blob/bccf1679aed0a5d86de87165c548f8c459758055/tests/handlers/test_sync.py#L1096-L1099

This PR attempts to recover new state events that only appeared first in
the leave batch.

### 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: Fefaine <fefaine@gmail.com>
Co-authored-by: Quentin Gliech <quenting@element.io>
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
Co-authored-by: Eric Eastwood <erice@element.io>
2026-10-19 09:25:23 +00:00