From 7b725988cea01b689fc783111f0af2d29afc34ea Mon Sep 17 00:00:00 2001 From: Yorusaka Miyabi <23130178+ShadowRZ@users.noreply.github.com> Date: Mon, 14 Jul 2025 12:52:50 +0800 Subject: [PATCH 1/6] Change default room version to 11. implments MSC4239 --- docs/usage/configuration/config_documentation.md | 4 +++- schema/synapse-config.schema.yaml | 6 +++++- synapse/config/server.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 1fff68ed0a1..0ef3035c2e0 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -342,7 +342,9 @@ For example, for room version 1, `default_room_version` should be set to "1". _Changed in Synapse 1.76:_ the default version room version was increased from [9](https://spec.matrix.org/v1.5/rooms/v9/) to [10](https://spec.matrix.org/v1.5/rooms/v10/). -Defaults to `"10"`. +_Changed in Synapse 1.134:_ the default version room version was increased from [9](https://spec.matrix.org/v1.12/rooms/v10/) to [10](https://spec.matrix.org/v1.12/rooms/v11/). + +Defaults to `"11"`. Example configuration: ```yaml diff --git a/schema/synapse-config.schema.yaml b/schema/synapse-config.schema.yaml index 26f0e7f0bcf..e350fc3f93d 100644 --- a/schema/synapse-config.schema.yaml +++ b/schema/synapse-config.schema.yaml @@ -265,7 +265,11 @@ properties: _Changed in Synapse 1.76:_ the default version room version was increased from [9](https://spec.matrix.org/v1.5/rooms/v9/) to [10](https://spec.matrix.org/v1.5/rooms/v10/). - default: "10" + + _Changed in Synapse 1.134:_ the default version room version was increased + from [10](https://spec.matrix.org/v1.12/rooms/v10/) to + [11](https://spec.matrix.org/v1.12/rooms/v11/). + default: "11" examples: - "8" gc_thresholds: diff --git a/synapse/config/server.py b/synapse/config/server.py index 68934509890..c1cd37dc568 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -158,7 +158,7 @@ def generate_ip_set( "fec0::/10", ] -DEFAULT_ROOM_VERSION = "10" +DEFAULT_ROOM_VERSION = "11" ROOM_COMPLEXITY_TOO_GREAT = ( "Your homeserver is unable to join rooms this large or complex. " From f58d9d1c371d4645480f922b0ac8d89194141fd8 Mon Sep 17 00:00:00 2001 From: Yorusaka Miyabi <23130178+ShadowRZ@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:03:50 +0800 Subject: [PATCH 2/6] Add changelog file --- changelog.d/18680.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/18680.feature diff --git a/changelog.d/18680.feature b/changelog.d/18680.feature new file mode 100644 index 00000000000..1c8fe2bf8ed --- /dev/null +++ b/changelog.d/18680.feature @@ -0,0 +1 @@ +Change default room version to 11, implmenting [MSC4239](https://github.com/matrix-org/matrix-spec-proposals/pull/4239). From 258a7e00e69bcb55c598e8998fe8071e74f9cc2d Mon Sep 17 00:00:00 2001 From: reivilibre Date: Tue, 15 Jul 2025 11:37:20 +0100 Subject: [PATCH 3/6] Update changelog.d/18680.feature --- changelog.d/18680.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/18680.feature b/changelog.d/18680.feature index 1c8fe2bf8ed..e4280d46789 100644 --- a/changelog.d/18680.feature +++ b/changelog.d/18680.feature @@ -1 +1 @@ -Change default room version to 11, implmenting [MSC4239](https://github.com/matrix-org/matrix-spec-proposals/pull/4239). +Change default room version to 11, implementing [MSC4239](https://github.com/matrix-org/matrix-spec-proposals/pull/4239) as part of Matrix v1.14. From 89e478e7dfcd67aff26471900ca204921622e621 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Tue, 15 Jul 2025 11:41:30 +0100 Subject: [PATCH 4/6] fixup config doc --- docs/usage/configuration/config_documentation.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 0ef3035c2e0..1793e8ebab6 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -341,8 +341,7 @@ Known room versions are listed [here](https://spec.matrix.org/latest/rooms/#comp For example, for room version 1, `default_room_version` should be set to "1". _Changed in Synapse 1.76:_ the default version room version was increased from [9](https://spec.matrix.org/v1.5/rooms/v9/) to [10](https://spec.matrix.org/v1.5/rooms/v10/). - -_Changed in Synapse 1.134:_ the default version room version was increased from [9](https://spec.matrix.org/v1.12/rooms/v10/) to [10](https://spec.matrix.org/v1.12/rooms/v11/). +_Changed in Synapse 1.134:_ the default version room version was increased from [10](https://spec.matrix.org/v1.12/rooms/v10/) to [11](https://spec.matrix.org/v1.12/rooms/v11/). Defaults to `"11"`. From a9cd65c8b27360bd39d9b55b6dd53a1b67c23d7c Mon Sep 17 00:00:00 2001 From: Yorusaka Miyabi <23130178+ShadowRZ@users.noreply.github.com> Date: Wed, 16 Jul 2025 15:01:01 +0800 Subject: [PATCH 5/6] Fix unittests --- .../test_federation_out_of_band_membership.py | 5 +---- tests/module_api/test_api.py | 18 ------------------ .../client/sliding_sync/test_rooms_invites.py | 8 ++++---- tests/rest/client/test_redactions.py | 2 +- tests/storage/databases/main/test_room.py | 2 +- 5 files changed, 7 insertions(+), 28 deletions(-) diff --git a/tests/federation/test_federation_out_of_band_membership.py b/tests/federation/test_federation_out_of_band_membership.py index f77b8fe3005..b8668ffacc8 100644 --- a/tests/federation/test_federation_out_of_band_membership.py +++ b/tests/federation/test_federation_out_of_band_membership.py @@ -193,7 +193,7 @@ def _invite_local_user_to_remote_room_and_join(self) -> RemoteRoomJoinResult: # Create a remote room room_creator_user_id = f"@remote-user:{self.OTHER_SERVER_NAME}" remote_room_id = f"!remote-room:{self.OTHER_SERVER_NAME}" - room_version = RoomVersions.V10 + room_version = RoomVersions.V11 room_create_event = make_event_from_dict( self.add_hashes_and_signatures_from_other_server( @@ -205,9 +205,6 @@ def _invite_local_user_to_remote_room_and_join(self) -> RemoteRoomJoinResult: "type": EventTypes.Create, "state_key": "", "content": { - # The `ROOM_CREATOR` field could be removed if we used a room - # version > 10 (in favor of relying on `sender`) - EventContentFields.ROOM_CREATOR: room_creator_user_id, EventContentFields.ROOM_VERSION: room_version.identifier, }, "auth_events": [], diff --git a/tests/module_api/test_api.py b/tests/module_api/test_api.py index b6ba472d7d4..1354373294c 100644 --- a/tests/module_api/test_api.py +++ b/tests/module_api/test_api.py @@ -751,15 +751,6 @@ def test_create_room(self) -> None: ) ) - # Check room creator. - channel = self.make_request( - "GET", - f"/_matrix/client/v3/rooms/{room_id}/state/m.room.create", - access_token=access_token, - ) - self.assertEqual(channel.code, 200, channel.result) - self.assertEqual(channel.json_body["creator"], user_id) - # Check room alias. self.assertEqual(room_alias, f"#foo-bar:{self.module_api.server_name}") @@ -768,15 +759,6 @@ def test_create_room(self) -> None: self.module_api.create_room(user_id=user_id, config={}, ratelimit=False) ) - # Check room creator. - channel = self.make_request( - "GET", - f"/_matrix/client/v3/rooms/{room_id}/state/m.room.create", - access_token=access_token, - ) - self.assertEqual(channel.code, 200, channel.result) - self.assertEqual(channel.json_body["creator"], user_id) - # Check room alias. self.assertIsNone(room_alias) diff --git a/tests/rest/client/sliding_sync/test_rooms_invites.py b/tests/rest/client/sliding_sync/test_rooms_invites.py index 882762ca29a..25b553a9fbe 100644 --- a/tests/rest/client/sliding_sync/test_rooms_invites.py +++ b/tests/rest/client/sliding_sync/test_rooms_invites.py @@ -143,7 +143,7 @@ def test_rooms_invite_shared_history_initial_sync(self) -> None: response_body["rooms"][room_id1]["invite_state"], [ { - "content": {"creator": user2_id, "room_version": "10"}, + "content": {"room_version": "11"}, "sender": user2_id, "state_key": "", "type": "m.room.create", @@ -253,7 +253,7 @@ def test_rooms_invite_shared_history_incremental_sync(self) -> None: response_body["rooms"][room_id1]["invite_state"], [ { - "content": {"creator": user2_id, "room_version": "10"}, + "content": {"room_version": "11"}, "sender": user2_id, "state_key": "", "type": "m.room.create", @@ -374,7 +374,7 @@ def test_rooms_invite_world_readable_history_initial_sync(self) -> None: response_body["rooms"][room_id1]["invite_state"], [ { - "content": {"creator": user2_id, "room_version": "10"}, + "content": {"room_version": "11"}, "sender": user2_id, "state_key": "", "type": "m.room.create", @@ -500,7 +500,7 @@ def test_rooms_invite_world_readable_history_incremental_sync(self) -> None: response_body["rooms"][room_id1]["invite_state"], [ { - "content": {"creator": user2_id, "room_version": "10"}, + "content": {"room_version": "11"}, "sender": user2_id, "state_key": "", "type": "m.room.create", diff --git a/tests/rest/client/test_redactions.py b/tests/rest/client/test_redactions.py index b25e1847862..831e5d9af10 100644 --- a/tests/rest/client/test_redactions.py +++ b/tests/rest/client/test_redactions.py @@ -64,7 +64,7 @@ def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None: # Create a room self.room_id = self.helper.create_room_as( - self.mod_user_id, tok=self.mod_access_token + self.mod_user_id, tok=self.mod_access_token, room_version="10" ) # Invite the other user diff --git a/tests/storage/databases/main/test_room.py b/tests/storage/databases/main/test_room.py index 88a5aa8cb17..ed6820279fe 100644 --- a/tests/storage/databases/main/test_room.py +++ b/tests/storage/databases/main/test_room.py @@ -47,7 +47,7 @@ def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None: def _generate_room(self) -> str: """Create a room and return the room ID.""" - return self.helper.create_room_as(self.user_id, tok=self.token) + return self.helper.create_room_as(self.user_id, tok=self.token, room_version="10") def run_background_updates(self, update_name: str) -> None: """Insert and run the background update.""" From e4d5c98f394648f0e702e4bd4a9ee3b4d65fd457 Mon Sep 17 00:00:00 2001 From: Yorusaka Miyabi <23130178+ShadowRZ@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:08:08 +0800 Subject: [PATCH 6/6] Fix code style violations --- tests/module_api/test_api.py | 1 - tests/storage/databases/main/test_room.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/module_api/test_api.py b/tests/module_api/test_api.py index 1354373294c..1a211f573bf 100644 --- a/tests/module_api/test_api.py +++ b/tests/module_api/test_api.py @@ -743,7 +743,6 @@ def test_create_room(self) -> None: # Now do the happy path. user_id = self.register_user("user", "password") - access_token = self.login(user_id, "password") room_id, room_alias = self.get_success( self.module_api.create_room( diff --git a/tests/storage/databases/main/test_room.py b/tests/storage/databases/main/test_room.py index ed6820279fe..97a6383b66b 100644 --- a/tests/storage/databases/main/test_room.py +++ b/tests/storage/databases/main/test_room.py @@ -47,7 +47,9 @@ def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None: def _generate_room(self) -> str: """Create a room and return the room ID.""" - return self.helper.create_room_as(self.user_id, tok=self.token, room_version="10") + return self.helper.create_room_as( + self.user_id, tok=self.token, room_version="10" + ) def run_background_updates(self, update_name: str) -> None: """Insert and run the background update."""