From ef13aef8c3751166032907ab2041fb1386fd7077 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 10 Feb 2019 19:31:25 -0700 Subject: [PATCH 1/4] Clarify the recommendations for "transferable state" Fixes https://github.com/matrix-org/matrix-doc/issues/1843 --- api/client-server/room_upgrades.yaml | 4 +--- specification/modules/room_upgrades.rst | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/api/client-server/room_upgrades.yaml b/api/client-server/room_upgrades.yaml index 6511d9fc..55ee14dc 100644 --- a/api/client-server/room_upgrades.yaml +++ b/api/client-server/room_upgrades.yaml @@ -31,9 +31,7 @@ paths: post: summary: Upgrades a room to a new room version. description: |- - Upgrades the given room to a particular room version, migrating as much - data as possible over to the new room. See the `room_upgrades <#room-upgrades>`_ - module for more information on what this entails. + Upgrades the given room to a particular room version. operationId: upgradeRoom security: - accessToken: [] diff --git a/specification/modules/room_upgrades.rst b/specification/modules/room_upgrades.rst index 49ff4414..20efbabd 100644 --- a/specification/modules/room_upgrades.rst +++ b/specification/modules/room_upgrades.rst @@ -47,9 +47,21 @@ When the client requests to upgrade a known room to a known version, the server: 1. Checks that the user has permission to send ``m.room.tombstone`` events in the room. 2. Creates a replacement room with a ``m.room.create`` event containing a ``predecessor`` field and the applicable ``room_version``. -3. Replicates the power levels, privacy, topic, and other transferable state events to - the new room. This generally excludes membership events but may include client-specified - events and other presentation details. +3. Replicates transferable state events to the new room. The exact details for what is + transferred is left as an implementation detail, however the recommended state events + to transfer are: + + * ``m.room.server_acl`` + * ``m.room.encryption`` + * ``m.room.name`` + * ``m.room.avatar`` + * ``m.room.topic`` + * ``m.room.guest_access`` + * ``m.room.history_visibility`` + * ``m.room.join_rules`` + + Membership events should not be transferred to the new room. + 4. Moves any local aliases to the new room. 5. Sends a ``m.room.tombstone`` event to the old room to indicate that it is not intended to be used any further. @@ -57,5 +69,5 @@ When the client requests to upgrade a known room to a known version, the server: of events and inviting new users. For example, setting ``events_default`` and ``invite`` to the greater of ``50`` and ``users_default + 1``. -When a user joins the new room, the server may wish to automatically transfer/replicate -some of the user's personalized settings such as notifications, tags, etc. +When a user joins the new room, the server should automatically transfer/replicate some of +the user's personalized settings such as notifications, tags, etc. From f67782230a6e26792b4a05f0cb5d63d7a54bd277 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 10 Feb 2019 19:35:23 -0700 Subject: [PATCH 2/4] changelog --- changelogs/client_server/newsfragments/1791.feature | 2 +- changelogs/client_server/newsfragments/1817.deprecation | 2 +- changelogs/client_server/newsfragments/1875.feature | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/client_server/newsfragments/1875.feature diff --git a/changelogs/client_server/newsfragments/1791.feature b/changelogs/client_server/newsfragments/1791.feature index ae961ad3..0a854c8f 100644 --- a/changelogs/client_server/newsfragments/1791.feature +++ b/changelogs/client_server/newsfragments/1791.feature @@ -1 +1 @@ -Add room version upgrades +Add room version upgrades. diff --git a/changelogs/client_server/newsfragments/1817.deprecation b/changelogs/client_server/newsfragments/1817.deprecation index 9a888e85..2c52d198 100644 --- a/changelogs/client_server/newsfragments/1817.deprecation +++ b/changelogs/client_server/newsfragments/1817.deprecation @@ -1 +1 @@ -Remove references to presence lists +Remove references to presence lists. diff --git a/changelogs/client_server/newsfragments/1875.feature b/changelogs/client_server/newsfragments/1875.feature new file mode 100644 index 00000000..0a854c8f --- /dev/null +++ b/changelogs/client_server/newsfragments/1875.feature @@ -0,0 +1 @@ +Add room version upgrades. From f058a0f40a404d8a2711b168e183724285787bf6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 10 Feb 2019 19:36:33 -0700 Subject: [PATCH 3/4] also power levels --- specification/modules/room_upgrades.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/modules/room_upgrades.rst b/specification/modules/room_upgrades.rst index 20efbabd..889c1068 100644 --- a/specification/modules/room_upgrades.rst +++ b/specification/modules/room_upgrades.rst @@ -59,6 +59,7 @@ When the client requests to upgrade a known room to a known version, the server: * ``m.room.guest_access`` * ``m.room.history_visibility`` * ``m.room.join_rules`` + * ``m.room.power_levels`` Membership events should not be transferred to the new room. From 22188ebfebb291ffb30a879045499aef12a9fef1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 10 Feb 2019 19:54:20 -0700 Subject: [PATCH 4/4] Further clarify why membership events are not to be transferred --- specification/modules/room_upgrades.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/modules/room_upgrades.rst b/specification/modules/room_upgrades.rst index 889c1068..f1861f72 100644 --- a/specification/modules/room_upgrades.rst +++ b/specification/modules/room_upgrades.rst @@ -61,7 +61,11 @@ When the client requests to upgrade a known room to a known version, the server: * ``m.room.join_rules`` * ``m.room.power_levels`` - Membership events should not be transferred to the new room. + Membership events should not be transferred to the new room due to technical limitations + of servers not being able to impersonate people from other homeservers. Additionally, + servers should not transfer state events which are sensitive to who sent them, such as + events outside of the Matrix namespace where clients may rely on the sender to match + certain criteria. 4. Moves any local aliases to the new room. 5. Sends a ``m.room.tombstone`` event to the old room to indicate that it is not intended