Skip to content

Famedly release/v1.158 - #279

Merged
FrenchGithubUser merged 37 commits into
masterfrom
famedly-release/v1.158
Aug 11, 2026
Merged

Famedly release/v1.158#279
FrenchGithubUser merged 37 commits into
masterfrom
famedly-release/v1.158

Conversation

@FrenchGithubUser

Copy link
Copy Markdown
Member

jakobrss and others added 30 commits July 15, 2026 11:18
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
…mbnailer (#18831)

Signed-off-by: cat <cat@plan9.rocks>
…pt instructions) (#19968)

As discussed in
[`#element-backend-internal:matrix.org`](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$29ZzRe7gg62UZmT0bgeseMs320Kb-Ub6DyaQE20-3ng?via=jki.re&via=element.io&via=matrix.org)

Our assumptions on why this was done previously: in the olden days you'd
get paged doing the redeploy even if everything was actually fine
(probably before we started doing rolling restarts?)
…macOS (#19962)

BSD vs GNU `sed` problems:
```shell
$ sed -i '0,/^\$id: .*/s||$id: https://element-hq.github.io/synapse/schema/synapse/v1.157/synapse-config.schema.json|' schema/synapse-config.schema.yaml
sed: 1: "schema/synapse-config.s ...": bad flag in substitute command: 'h'
```
Conflicts:
	scripts-dev/release.py
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
…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).
…19966)

The cache key of `_get_server_keys_json` is a single argument which is
itself a `(server_name, key_id)` tuple, and `store_server_keys_response`
passed that nested tuple straight into the cache invalidation stream.
psycopg2 quietly serialises the inner tuple as a Postgres *record*, so
the `keys` column of `cache_invalidation_stream_by_instance` ended up
holding the record literal as a single string (e.g.
`{"(srv,ed25519:abc)"}`) — which never matches the real cache key on the
receiving side, i.e. the
invalidation has always been a silent no-op on workers. The native Rust
backend's stricter parameter conversion turns the same nested tuple into
a loud `TypeError: unsupported parameter type for postgres: tuple`.

Fix it the same way element-hq/synapse#18899 did
for `_get_e2e_cross_signing_signatures_for_device`, which has the same
nested-tuple key shape: invalidate the local cache directly, JSON-encode
the key for the replication row, and decode it again in
`process_replication_rows`.

Found as part of the the effort to port the database pool to Rust.
This reverts commit befd2e2.
…hutdown (#20009)

Use weakref to Python `DatabasePool` to allow homeserver to cleanly
shutdown

Spawning from
[upgrading](element-hq/synapse-small-hosts#420 (comment))
the Synapse version in Synapse Pro for small hosts and seeing our tenant
deprovision tests failing (end-to-end Complement tests). Specifically,
it was failing with a test in
[`TestLogging`](https://github.com/element-hq/synapse-small-hosts/blob/f24ee731ff419890680d1d80ef6eafe44f87f2c2/complement/tests/multi_synapse/logging_test.go#L328-L385)
in CI but was equally reproducible with any test where we deprovision
(`deployment.StopServer(...)`) like
[`TestProvisionHomeserverTenant/deprovision_homeserver_tenant`](https://github.com/element-hq/synapse-small-hosts/blob/f24ee731ff419890680d1d80ef6eafe44f87f2c2/complement/tests/multi_synapse/provision_test.go#L48-L58).

Clean homeserver shutdown specifically regressed with the changes from
element-hq/synapse#19878. The
`PythonDatabasePoolWrapper` in Rust holds onto a reference to the Python
`DatabasePool` which references the Python `HomeServer` and keeps the
`HomeServer` from being garbage collected on the Python side.

This PR updates `PythonDatabasePoolWrapper` to use a weak reference.


### Dev notes

Previous PR where we had to deal with Rust <-> Python reference cycles,
element-hq/synapse#19837 (comment)

PyO3 garbage collector docs (`__traverse__`, `__clear__`):
https://pyo3.rs/v0.28.3/class/protocols#garbage-collector-integration


### 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))
Signed-off-by: dependabot[bot] <support@github.com>
…#19984)

This means we can point to a single source of truth instead of
duplicating the content to the tag and GitHub release. Less to manage
and worry about when you make some updates to the changelog (maintenance
burden). We also get to avoid the content sitting in the vendor lock-in
GitHub releases.

We point to
`https://github.com/element-hq/synapse/blob/{repo.active_branch.name}/CHANGES.md`
as it will have the relevant changelog entry at the top and won't change
as we archive releases on `develop`. Even for RC releases after the main
release goes out, the entry will still be towards the top. We could try
to get the heading anchor for the specific section but I thought that it
wasn't necessary (nice but more complex).
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
…room version mismatch) (#20015)

Fix `RemoteJoinHelper` signing events with mismatched room version
compared to the `room_version` arg. The default room version on
`develop` is `11` but the `RemoteJoinHelper` `room_version` arg defaults
to `10` (room version mismatch). This mismatch wasn't present where this
fix was developed
(element-hq/synapse-private#136) as the default
room version was only recently bumped to `11` via
element-hq/synapse#18680 (not even in a release
yet).

Fixes the CI being broken on `develop` ❌:

```
[ERROR]
Traceback (most recent call last):
  File "/home/runner/work/synapse/synapse/tests/federation/test_federation_join_upgraded_room.py", line 298, in test_no_transfer_when_tombstone_does_not_match
    join_helper.join(local_user_id, local_user_tok)
  File "/home/runner/work/synapse/synapse/tests/federation/_remote_join.py", line 350, in join
    self._test_case.helper.join(remote_room_id, local_user_id, tok=local_user_tok)
  File "/home/runner/work/synapse/synapse/tests/rest/client/utils.py", line 195, in join
    return self.change_membership(
  File "/home/runner/work/synapse/synapse/tests/rest/client/utils.py", line 333, in change_membership
    assert channel.code == expect_code, (
builtins.AssertionError: Expected: 200, got: 400, PUT /_matrix/client/r0/rooms/!remote-room:other.example.com/state/m.room.member/@user1:test?access_token=syt_dXNlcjE_JSEarRndiAGqtydnrdLn_33qlLD -> resp: b'{"errcode":"M_UNKNOWN","error":"No create event in state"}'

tests.federation.test_federation_join_upgraded_room.FederationJoinUpgradedRoomTestCase.test_no_transfer_when_tombstone_does_not_match
```

These tests were originally introduced
element-hq/synapse-private#136 (developed
private as this was part of the Synapse security release) and introduced
into the public codebase via
element-hq/synapse@cbc6934
…er federation. (#20019)

Closes: element-hq/synapse#19904

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.44939% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.73%. Comparing base (b9c9b2a) to head (9d97a90).

Files with missing lines Patch % Lines
synapse/media/media_repository.py 80.00% 4 Missing and 2 partials ⚠️
synapse/federation/federation_server.py 70.58% 4 Missing and 1 partial ⚠️
synapse/media/thumbnailer.py 89.36% 2 Missing and 3 partials ⚠️
synapse/module_api/callbacks/federation.py 93.61% 2 Missing and 1 partial ⚠️
synapse/storage/databases/main/cache.py 66.66% 3 Missing ⚠️
synapse/config/repository.py 91.30% 2 Missing ⚠️
synapse/federation/sender/transaction_manager.py 83.33% 1 Missing and 1 partial ⚠️
synapse/handlers/federation.py 33.33% 1 Missing and 1 partial ⚠️
synapse/handlers/room.py 85.71% 1 Missing and 1 partial ⚠️
synapse/module_api/__init__.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
+ Coverage   80.58%   80.73%   +0.15%     
==========================================
  Files         501      503       +2     
  Lines       72107    72286     +179     
  Branches    10848    10872      +24     
==========================================
+ Hits        58105    58363     +258     
+ Misses      10755    10658      -97     
- Partials     3247     3265      +18     
Files with missing lines Coverage Δ
synapse/api/errors.py 88.19% <100.00%> (+0.26%) ⬆️
synapse/config/server.py 68.94% <100.00%> (ø)
synapse/federation/transport/server/federation.py 75.90% <100.00%> (+1.40%) ⬆️
synapse/module_api/callbacks/__init__.py 100.00% <100.00%> (ø)
...module_api/callbacks/media_repository_callbacks.py 98.18% <ø> (ø)
synapse/rest/client/media.py 99.18% <100.00%> (+0.01%) ⬆️
synapse/rest/media/thumbnail_resource.py 100.00% <100.00%> (ø)
synapse/rest/synapse/client/__init__.py 93.10% <100.00%> (+0.24%) ⬆️
...rest/synapse/client/media_upload_limit_exceeded.py 100.00% <100.00%> (ø)
synapse/storage/databases/main/keys.py 85.93% <100.00%> (+0.45%) ⬆️
... and 10 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9c9b2a...9d97a90. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread .ci/scripts/calculate_builds.py
Comment thread docs/usage/configuration/config_documentation.md
@FrenchGithubUser
FrenchGithubUser marked this pull request as ready for review August 10, 2026 16:19
@FrenchGithubUser
FrenchGithubUser requested a review from a team as a code owner August 10, 2026 16:19

@jason-famedly jason-famedly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jason-famedly

Copy link
Copy Markdown
Member

TestThreadedReceipts is a known flakey complement test

@FrenchGithubUser
FrenchGithubUser added this pull request to the merge queue Aug 11, 2026
Merged via the queue into master with commit 013821e Aug 11, 2026
73 of 75 checks passed
@FrenchGithubUser
FrenchGithubUser deleted the famedly-release/v1.158 branch August 11, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants