Skip to content

Commit 740fc88

Browse files
committed
Merge branch 'master' into develop
2 parents d0873d5 + 9a62b2d commit 740fc88

18 files changed

+122
-103
lines changed

CHANGES.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,49 @@
1+
# Synapse 1.129.0 (2025-05-06)
2+
3+
No significant changes since 1.129.0rc2.
4+
5+
6+
7+
8+
# Synapse 1.129.0rc2 (2025-04-30)
9+
10+
Synapse 1.129.0rc1 was never formally released due to regressions discovered during the release process. 1.129.0rc2 fixes those regressions by reverting the affected PRs.
11+
12+
### Internal Changes
13+
14+
- Revert the slow background update introduced by [\#18068](https://github.com/element-hq/synapse/issues/18068) in v1.128.0. ([\#18372](https://github.com/element-hq/synapse/issues/18372))
15+
- Revert "Add total event, unencrypted message, and e2ee event counts to stats reporting", added in v1.129.0rc1. ([\#18373](https://github.com/element-hq/synapse/issues/18373))
16+
17+
18+
19+
20+
# Synapse 1.129.0rc1 (2025-04-15)
21+
22+
### Features
23+
24+
- Add `passthrough_authorization_parameters` in OIDC configuration to allow passing parameters to the authorization grant URL. ([\#18232](https://github.com/element-hq/synapse/issues/18232))
25+
- Add `total_event_count`, `total_message_count`, and `total_e2ee_event_count` fields to the homeserver usage statistics. ([\#18260](https://github.com/element-hq/synapse/issues/18260))
26+
27+
### Bugfixes
28+
29+
- Fix `force_tracing_for_users` config when using delegated auth. ([\#18334](https://github.com/element-hq/synapse/issues/18334))
30+
- Fix the token introspection cache logging access tokens when MAS integration is in use. ([\#18335](https://github.com/element-hq/synapse/issues/18335))
31+
- Stop caching introspection failures when delegating auth to MAS. ([\#18339](https://github.com/element-hq/synapse/issues/18339))
32+
- Fix `ExternalIDReuse` exception after migrating to MAS on workers with a high traffic. ([\#18342](https://github.com/element-hq/synapse/issues/18342))
33+
- Fix minor performance regression caused by tracking of room participation. Regressed in v1.128.0. ([\#18345](https://github.com/element-hq/synapse/issues/18345))
34+
35+
### Updates to the Docker image
36+
37+
- Optimize the build of the complement-synapse image. ([\#18294](https://github.com/element-hq/synapse/issues/18294))
38+
39+
### Internal Changes
40+
41+
- Disable statement timeout during room purge. ([\#18133](https://github.com/element-hq/synapse/issues/18133))
42+
- Add cache to storage functions used to auth requests when using delegated auth. ([\#18337](https://github.com/element-hq/synapse/issues/18337))
43+
44+
45+
46+
147
# Synapse 1.128.0 (2025-04-08)
248

349
No significant changes since 1.128.0rc1.

changelog.d/18133.misc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18232.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18294.docker

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18334.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18335.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18337.misc

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18339.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18342.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/18345.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/changelog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
matrix-synapse-py3 (1.129.0) stable; urgency=medium
2+
3+
* New Synapse release 1.129.0.
4+
5+
-- Synapse Packaging team <[email protected]> Tue, 06 May 2025 12:22:11 +0100
6+
7+
matrix-synapse-py3 (1.129.0~rc2) stable; urgency=medium
8+
9+
* New synapse release 1.129.0rc2.
10+
11+
-- Synapse Packaging team <[email protected]> Wed, 30 Apr 2025 13:13:16 +0000
12+
13+
matrix-synapse-py3 (1.129.0~rc1) stable; urgency=medium
14+
15+
* New Synapse release 1.129.0rc1.
16+
17+
-- Synapse Packaging team <[email protected]> Tue, 15 Apr 2025 10:47:43 -0600
18+
119
matrix-synapse-py3 (1.128.0) stable; urgency=medium
220

321
* New Synapse release 1.128.0.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module-name = "synapse.synapse_rust"
9797

9898
[tool.poetry]
9999
name = "matrix-synapse"
100-
version = "1.128.0"
100+
version = "1.129.0"
101101
description = "Homeserver for the Matrix decentralised comms protocol"
102102
authors = ["Matrix.org Team and Contributors <[email protected]>"]
103103
license = "AGPL-3.0-or-later"

synapse/storage/databases/main/roommember.py

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,93 +1693,6 @@ def __init__(
16931693
columns=["user_id", "room_id"],
16941694
)
16951695

1696-
self.db_pool.updates.register_background_update_handler(
1697-
"populate_participant_bg_update", self._populate_participant
1698-
)
1699-
1700-
async def _populate_participant(self, progress: JsonDict, batch_size: int) -> int:
1701-
"""
1702-
Background update to populate column `participant` on `room_memberships` table
1703-
1704-
A 'participant' is someone who is currently joined to a room and has sent at least
1705-
one `m.room.message` or `m.room.encrypted` event.
1706-
1707-
This background update will set the `participant` column across all rows in
1708-
`room_memberships` based on the user's *current* join status, and if
1709-
they've *ever* sent a message or encrypted event. Therefore one should
1710-
never assume the `participant` column's value is based solely on whether
1711-
the user participated in a previous "session" (where a "session" is defined
1712-
as a period between the user joining and leaving). See
1713-
https://github.com/element-hq/synapse/pull/18068#discussion_r1931070291
1714-
for further detail.
1715-
"""
1716-
stream_token = progress.get("last_stream_token", None)
1717-
1718-
def _get_max_stream_token_txn(txn: LoggingTransaction) -> int:
1719-
sql = """
1720-
SELECT event_stream_ordering from room_memberships
1721-
ORDER BY event_stream_ordering DESC
1722-
LIMIT 1;
1723-
"""
1724-
txn.execute(sql)
1725-
res = txn.fetchone()
1726-
if not res or not res[0]:
1727-
return 0
1728-
return res[0]
1729-
1730-
def _background_populate_participant_txn(
1731-
txn: LoggingTransaction, stream_token: str
1732-
) -> None:
1733-
sql = """
1734-
UPDATE room_memberships
1735-
SET participant = True
1736-
FROM (
1737-
SELECT DISTINCT c.state_key, e.room_id
1738-
FROM current_state_events AS c
1739-
INNER JOIN events AS e ON c.room_id = e.room_id
1740-
WHERE c.membership = 'join'
1741-
AND c.state_key = e.sender
1742-
AND (
1743-
e.type = 'm.room.message'
1744-
OR e.type = 'm.room.encrypted'
1745-
)
1746-
) AS subquery
1747-
WHERE room_memberships.user_id = subquery.state_key
1748-
AND room_memberships.room_id = subquery.room_id
1749-
AND room_memberships.event_stream_ordering <= ?
1750-
AND room_memberships.event_stream_ordering > ?;
1751-
"""
1752-
batch = int(stream_token) - _POPULATE_PARTICIPANT_BG_UPDATE_BATCH_SIZE
1753-
txn.execute(sql, (stream_token, batch))
1754-
1755-
if stream_token is None:
1756-
stream_token = await self.db_pool.runInteraction(
1757-
"_get_max_stream_token", _get_max_stream_token_txn
1758-
)
1759-
1760-
if stream_token < 0:
1761-
await self.db_pool.updates._end_background_update(
1762-
"populate_participant_bg_update"
1763-
)
1764-
return _POPULATE_PARTICIPANT_BG_UPDATE_BATCH_SIZE
1765-
1766-
await self.db_pool.runInteraction(
1767-
"_background_populate_participant_txn",
1768-
_background_populate_participant_txn,
1769-
stream_token,
1770-
)
1771-
1772-
progress["last_stream_token"] = (
1773-
stream_token - _POPULATE_PARTICIPANT_BG_UPDATE_BATCH_SIZE
1774-
)
1775-
await self.db_pool.runInteraction(
1776-
"populate_participant_bg_update",
1777-
self.db_pool.updates._background_update_progress_txn,
1778-
"populate_participant_bg_update",
1779-
progress,
1780-
)
1781-
return _POPULATE_PARTICIPANT_BG_UPDATE_BATCH_SIZE
1782-
17831696
async def _background_add_membership_profile(
17841697
self, progress: JsonDict, batch_size: int
17851698
) -> int:

synapse/storage/schema/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020
#
2121

22-
SCHEMA_VERSION = 91 # remember to update the list below when updating
22+
SCHEMA_VERSION = 92 # remember to update the list below when updating
2323
"""Represents the expectations made by the codebase about the database schema
2424
2525
This should be incremented whenever the codebase changes its requirements on the
@@ -162,6 +162,12 @@
162162
Changes in SCHEMA_VERSION = 90
163163
- Add a column `participant` to `room_memberships` table
164164
- Add background update to delete unreferenced state groups.
165+
166+
Changes in SCHEMA_VERSION = 91
167+
- Add a `sha256` column to the `local_media_repository` and `remote_media_cache` tables.
168+
169+
Changes in SCHEMA_VERSION = 92
170+
- Cleaned up a trigger that was added in #18260 and then reverted.
165171
"""
166172

167173

synapse/storage/schema/main/delta/90/01_add_column_participant_room_memberships_table.sql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@
1313

1414
-- Add a column `participant` to `room_memberships` table to track whether a room member has sent
1515
-- a `m.room.message` or `m.room.encrypted` event into a room they are a member of
16-
ALTER TABLE room_memberships ADD COLUMN participant BOOLEAN DEFAULT FALSE;
17-
18-
-- Add a background update to populate `participant` column
19-
INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
20-
(9001, 'populate_participant_bg_update', '{}');
16+
ALTER TABLE room_memberships ADD COLUMN participant BOOLEAN DEFAULT FALSE;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--
2+
-- This file is licensed under the Affero General Public License (AGPL) version 3.
3+
--
4+
-- Copyright (C) 2025 New Vector, Ltd
5+
--
6+
-- This program is free software: you can redistribute it and/or modify
7+
-- it under the terms of the GNU Affero General Public License as
8+
-- published by the Free Software Foundation, either version 3 of the
9+
-- License, or (at your option) any later version.
10+
--
11+
-- See the GNU Affero General Public License for more details:
12+
-- <https://www.gnu.org/licenses/agpl-3.0.html>.
13+
14+
-- Removes the trigger that was added in #18260 and then reverted
15+
DROP TRIGGER IF EXISTS event_stats_increment_counts_trigger ON events;
16+
DROP FUNCTION IF EXISTS event_stats_increment_counts();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--
2+
-- This file is licensed under the Affero General Public License (AGPL) version 3.
3+
--
4+
-- Copyright (C) 2025 New Vector, Ltd
5+
--
6+
-- This program is free software: you can redistribute it and/or modify
7+
-- it under the terms of the GNU Affero General Public License as
8+
-- published by the Free Software Foundation, either version 3 of the
9+
-- License, or (at your option) any later version.
10+
--
11+
-- See the GNU Affero General Public License for more details:
12+
-- <https://www.gnu.org/licenses/agpl-3.0.html>.
13+
14+
-- Removes the trigger that was added in #18260 and then reverted
15+
DROP TRIGGER IF EXISTS event_stats_events_insert_trigger;
16+
DROP TRIGGER IF EXISTS event_stats_events_delete_trigger;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--
2+
-- This file is licensed under the Affero General Public License (AGPL) version 3.
3+
--
4+
-- Copyright (C) 2025 New Vector, Ltd
5+
--
6+
-- This program is free software: you can redistribute it and/or modify
7+
-- it under the terms of the GNU Affero General Public License as
8+
-- published by the Free Software Foundation, either version 3 of the
9+
-- License, or (at your option) any later version.
10+
--
11+
-- See the GNU Affero General Public License for more details:
12+
-- <https://www.gnu.org/licenses/agpl-3.0.html>.
13+
14+
-- Remove the background update if it was scheduled, as it is not rollback-safe
15+
-- See https://github.com/element-hq/synapse/issues/18356 for context
16+
DELETE FROM background_updates
17+
WHERE update_name = 'populate_participant_bg_update';

0 commit comments

Comments
 (0)