Skip to content

Change default room version to 11. implements MSC4239 #18680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/18680.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change default room version to 11, implementing [MSC4239](https://github.com/matrix-org/matrix-spec-proposals/pull/4239) as part of Matrix v1.14.
3 changes: 2 additions & 1 deletion docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,9 @@ 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 [10](https://spec.matrix.org/v1.12/rooms/v10/) to [11](https://spec.matrix.org/v1.12/rooms/v11/).

Defaults to `"10"`.
Defaults to `"11"`.

Example configuration:
```yaml
Expand Down
6 changes: 5 additions & 1 deletion schema/synapse-config.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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": [],
Expand Down
19 changes: 0 additions & 19 deletions tests/module_api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,23 +743,13 @@ 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(
user_id=user_id, config={"room_alias_name": "foo-bar"}, 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.assertEqual(room_alias, f"#foo-bar:{self.module_api.server_name}")

Expand All @@ -768,15 +758,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)

Expand Down
8 changes: 4 additions & 4 deletions tests/rest/client/sliding_sync/test_rooms_invites.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/test_redactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/storage/databases/main/test_room.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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."""
Expand Down
Loading