Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Change knocking room version to v7 #88

Merged
merged 1 commit into from
Mar 18, 2021
Merged
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
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ steps:
- "docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile ."
# We use the complement:latest image to provide Complement's dependencies, but want
# to actually run against the latest version of Complement, so download it here.
- "wget https://github.com/matrix-org/complement/archive/master.tar.gz"
- "wget https://github.com/matrix-org/complement/archive/anoa/knock_room_v7.tar.gz"
- "tar -xzf master.tar.gz"
# Build a second docker image on top of the above image. This one sets up Synapse with a generated config file,
# signing and SSL keys so Synapse can run and federate
Expand Down
17 changes: 9 additions & 8 deletions synapse/api/room_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,29 +147,29 @@ class RoomVersions:
msc2176_redaction_rules=False,
allow_knocking=False,
)
MSC2176 = RoomVersion(
"org.matrix.msc2176",
V7 = RoomVersion(
"7",
RoomDisposition.UNSTABLE,
EventFormatVersions.V3,
StateResolutionVersions.V2,
enforce_key_validity=True,
special_case_aliases_auth=False,
strict_canonicaljson=True,
limit_notifications_power_levels=True,
msc2176_redaction_rules=True,
allow_knocking=False,
msc2176_redaction_rules=False,
allow_knocking=True,
)
MSC2403_DEV = RoomVersion(
"xyz.amorgan.knock",
MSC2176 = RoomVersion(
"org.matrix.msc2176",
RoomDisposition.UNSTABLE,
EventFormatVersions.V3,
StateResolutionVersions.V2,
enforce_key_validity=True,
special_case_aliases_auth=False,
strict_canonicaljson=True,
limit_notifications_power_levels=True,
msc2176_redaction_rules=False,
allow_knocking=True,
msc2176_redaction_rules=True,
allow_knocking=False,
)


Expand All @@ -182,5 +182,6 @@ class RoomVersions:
RoomVersions.V4,
RoomVersions.V5,
RoomVersions.V6,
RoomVersions.V7,
)
} # type: Dict[str, RoomVersion]
4 changes: 1 addition & 3 deletions synapse/config/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ def read_config(self, config: JsonDict, **kwargs):
self.msc2403_enabled = experimental.get("msc2403_enabled", False) # type: bool
if self.msc2403_enabled:
# Enable the MSC2403 unstable room version
KNOWN_ROOM_VERSIONS.update(
{RoomVersions.MSC2403_DEV.identifier: RoomVersions.MSC2403_DEV}
)
KNOWN_ROOM_VERSIONS.update({RoomVersions.V7.identifier: RoomVersions.V7})
10 changes: 5 additions & 5 deletions tests/federation/transport/test_knocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def send_example_state_events_to_room(
self.get_success(
event_injection.inject_event(
hs,
room_version=RoomVersions.MSC2403_DEV.identifier,
room_version=RoomVersions.V7.identifier,
room_id=room_id,
sender=sender,
type="com.example.secret",
Expand Down Expand Up @@ -121,7 +121,7 @@ def send_example_state_events_to_room(
self.get_success(
event_injection.inject_event(
hs,
room_version=RoomVersions.MSC2403_DEV.identifier,
room_version=RoomVersions.V7.identifier,
room_id=room_id,
sender=sender,
type=event_type,
Expand Down Expand Up @@ -218,7 +218,7 @@ def test_room_state_returned_when_knocking(self):
room_id = self.helper.create_room_as(
"u1",
is_public=False,
room_version=RoomVersions.MSC2403_DEV.identifier,
room_version=RoomVersions.V7.identifier,
tok=user_token,
)

Expand All @@ -236,7 +236,7 @@ def test_room_state_returned_when_knocking(self):
fake_knocking_user_id,
# Inform the remote that we support the room version of the room we're
# knocking on
RoomVersions.MSC2403_DEV.identifier,
RoomVersions.V7.identifier,
),
)
self.assertEquals(200, channel.code, channel.result)
Expand All @@ -261,7 +261,7 @@ def test_room_state_returned_when_knocking(self):
self.clock,
self.hs.hostname,
self.hs.signing_key,
room_version=RoomVersions.MSC2403_DEV,
room_version=RoomVersions.V7,
event_dict=knock_event,
)

Expand Down
3 changes: 2 additions & 1 deletion tests/rest/client/v2_alpha/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import synapse.rest.admin
from synapse.api.constants import EventContentFields, EventTypes, RelationTypes
from synapse.api.room_versions import RoomVersions
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import knock, read_marker, sync

Expand Down Expand Up @@ -342,7 +343,7 @@ def prepare(self, reactor, clock, hs):
self.room_id = self.helper.create_room_as(
self.user_id,
is_public=False,
room_version="xyz.amorgan.knock",
room_version=RoomVersions.V7.identifier,
tok=self.tok,
)

Expand Down