From 150b07ba81ede60879f7db1346d8f645bd407141 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 9 Sep 2021 14:15:08 +0000 Subject: [PATCH 01/15] initial --- proposals/xxxx-account-data-delete.md | 80 +++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 proposals/xxxx-account-data-delete.md diff --git a/proposals/xxxx-account-data-delete.md b/proposals/xxxx-account-data-delete.md new file mode 100644 index 00000000000..da479c4ac09 --- /dev/null +++ b/proposals/xxxx-account-data-delete.md @@ -0,0 +1,80 @@ +# MSCXXXX: Deleting account data + +## Proposal + +### Endpoints + +Account data and room data currently have the following endpoints; + +``` +GET /_matrix/client/r0/user/{userId}/account_data/{type} + +PUT /_matrix/client/r0/user/{userId}/account_data/{type} + +GET /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} + +PUT /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} +``` + +This proposal aims to add the following two endpoints; + +``` +DELETE /_matrix/client/r0/user/{userId}/account_data/{type} + +DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} +``` + +With no body. + +### Sync + +Account Data changes are announced through sync, this proposal also aims to add the following to sync; + +```json5 + +{ + // ... + "account_data_removed": ["m.direct", "m.push_rules"], // <- NEW + // ... + "rooms": { + "join": { + "!this-is-a-room:example.com": { + // ... + "account_data_removed": ["m.tag", "m.fully_read"], // <- NEW + // ... + } + } + }, + // ... +} + +``` + +Which are the tags that were removed since `since` and `next_batch`, if `since` is specified and valid. + + +## Potential issues + +Desync is possible, and so if there's a situation where the client has a different view on account +data than the server, it should query the account data wherever possible. + +## Security considerations + +No considerable security problems, other than the fact that a user can potentially delete important data. + +Though, for the purposes of this proposal, that is seen as a proper feature of CRUD :) + +## Unstable prefix + +When implementing this proposal, servers should use the `org.matrix.mscXXXX` unstable prefix; + +``` +DELETE /_matrix/client/unstable/org.matrix.mscXXXX/user/{userId}/account_data/{type} + +DELETE /_matrix/client/unstable/org.matrix.mscXXXX/user/{userId}/rooms/{roomId}/account_data/{type} +``` + +And `org.matrix.mscXXXX.account_data_removed` for sync. + +**Note:** As this operation would be largely "unknown" to clients, +cache invalidation problems could occur as clients could aggressively cache account data. \ No newline at end of file From faacd538f01948ca2107bc18b39fb5571638d6b4 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 9 Sep 2021 14:17:01 +0000 Subject: [PATCH 02/15] rename --- ...ount-data-delete.md => 3391-account-data-delete.md} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename proposals/{xxxx-account-data-delete.md => 3391-account-data-delete.md} (88%) diff --git a/proposals/xxxx-account-data-delete.md b/proposals/3391-account-data-delete.md similarity index 88% rename from proposals/xxxx-account-data-delete.md rename to proposals/3391-account-data-delete.md index da479c4ac09..c2ef3508bca 100644 --- a/proposals/xxxx-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -1,4 +1,4 @@ -# MSCXXXX: Deleting account data +# MSC3391: Deleting account data ## Proposal @@ -66,15 +66,15 @@ Though, for the purposes of this proposal, that is seen as a proper feature of C ## Unstable prefix -When implementing this proposal, servers should use the `org.matrix.mscXXXX` unstable prefix; +When implementing this proposal, servers should use the `org.matrix.msc3391` unstable prefix; ``` -DELETE /_matrix/client/unstable/org.matrix.mscXXXX/user/{userId}/account_data/{type} +DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/account_data/{type} -DELETE /_matrix/client/unstable/org.matrix.mscXXXX/user/{userId}/rooms/{roomId}/account_data/{type} +DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/rooms/{roomId}/account_data/{type} ``` -And `org.matrix.mscXXXX.account_data_removed` for sync. +And `org.matrix.msc3391.account_data_removed` for sync. **Note:** As this operation would be largely "unknown" to clients, cache invalidation problems could occur as clients could aggressively cache account data. \ No newline at end of file From 186471509c383df279288b6dba412ab20d6665a1 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 9 Sep 2021 14:24:55 +0000 Subject: [PATCH 03/15] more clarifications --- proposals/3391-account-data-delete.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index c2ef3508bca..4ceba6890bb 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -16,7 +16,7 @@ GET /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} PUT /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} ``` -This proposal aims to add the following two endpoints; +This proposal aims to add the following two endpoints (with no body); ``` DELETE /_matrix/client/r0/user/{userId}/account_data/{type} @@ -24,7 +24,7 @@ DELETE /_matrix/client/r0/user/{userId}/account_data/{type} DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} ``` -With no body. +These, respectively, removes account-wide account data, and room-scoped account data. ### Sync @@ -50,8 +50,18 @@ Account Data changes are announced through sync, this proposal also aims to add ``` +Providing an optional `account_data_removed` key, containing an array which references the deleted account-data types. + Which are the tags that were removed since `since` and `next_batch`, if `since` is specified and valid. +If between `since` and `next_batch` the account data has been deleted and re-created, this field shouldn't exist, +and data should be just put in `account_data` as if it's a normal change/creation. + +If, for some reason, an event type exists in both `account_data_removed` and `account_data`, the reference in +`account_data_removed` must be ignored. + +Full-state syncs must not include `account_data_removed`, but consequently clients must see anything +in `account_data` as replacing what existed previously. ## Potential issues From 9c1ac3f276cea4a902bb42919de5b7dda698d9ed Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 9 Sep 2021 14:29:36 +0000 Subject: [PATCH 04/15] change approach to account_data.removed_events --- proposals/3391-account-data-delete.md | 37 +++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 4ceba6890bb..ebacf2b496d 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -34,15 +34,31 @@ Account Data changes are announced through sync, this proposal also aims to add { // ... - "account_data_removed": ["m.direct", "m.push_rules"], // <- NEW + "account_data": { + "events": [ + { + // ... + } + ], + "removed_events": ["m.direct", "m.push_rules"] // <- NEW + }, // ... "rooms": { "join": { + "!this-is-a-room:example.com": { // ... - "account_data_removed": ["m.tag", "m.fully_read"], // <- NEW + "account_data": { + "events": [ + { + // ... + } + ], + "removed_events": ["m.tag", "m.fully_read"] // <- NEW + } // ... - } + }, + } }, // ... @@ -50,18 +66,19 @@ Account Data changes are announced through sync, this proposal also aims to add ``` -Providing an optional `account_data_removed` key, containing an array which references the deleted account-data types. +Providing an optional `removed_events` key per every `account_data` object, +containing an array which references the deleted account-data types. -Which are the tags that were removed since `since` and `next_batch`, if `since` is specified and valid. +These are the tags that were removed since `since` and `next_batch`, if `since` is specified and valid. If between `since` and `next_batch` the account data has been deleted and re-created, this field shouldn't exist, -and data should be just put in `account_data` as if it's a normal change/creation. +and data should be just put in `account_data.events` as if it's a normal change/creation. -If, for some reason, an event type exists in both `account_data_removed` and `account_data`, the reference in -`account_data_removed` must be ignored. +If, for some reason, an event type exists in both `account_data.events` and `account_data.removed_events`, the reference in +`.removed_events` must be ignored. -Full-state syncs must not include `account_data_removed`, but consequently clients must see anything -in `account_data` as replacing what existed previously. +Full-state syncs must not include `.removed_events`, but consequently clients must see anything +in `events` as replacing what existed previously. ## Potential issues From 861933a3a9a7f9efa520e45e92c48a77a749b6b1 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 9 Sep 2021 14:30:32 +0000 Subject: [PATCH 05/15] fix indentation and unstable use --- proposals/3391-account-data-delete.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index ebacf2b496d..275615df186 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -50,10 +50,10 @@ Account Data changes are announced through sync, this proposal also aims to add // ... "account_data": { "events": [ - { - // ... - } - ], + { + // ... + } + ], "removed_events": ["m.tag", "m.fully_read"] // <- NEW } // ... @@ -101,7 +101,7 @@ DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/account_data/{t DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/rooms/{roomId}/account_data/{type} ``` -And `org.matrix.msc3391.account_data_removed` for sync. +And `org.matrix.msc3391.removed_events` for `account_data` sync. **Note:** As this operation would be largely "unknown" to clients, cache invalidation problems could occur as clients could aggressively cache account data. \ No newline at end of file From 60b1bd3a6928b188091213c7a1cf11f1d5d84beb Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Fri, 15 Apr 2022 19:53:22 +0000 Subject: [PATCH 06/15] the future is now, old man --- proposals/3391-account-data-delete.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 275615df186..9ce99e2f02f 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -7,21 +7,21 @@ Account data and room data currently have the following endpoints; ``` -GET /_matrix/client/r0/user/{userId}/account_data/{type} +GET /_matrix/client/v3/user/{userId}/account_data/{type} -PUT /_matrix/client/r0/user/{userId}/account_data/{type} +PUT /_matrix/client/v3/user/{userId}/account_data/{type} -GET /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} +GET /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} -PUT /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} +PUT /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} ``` This proposal aims to add the following two endpoints (with no body); ``` -DELETE /_matrix/client/r0/user/{userId}/account_data/{type} +DELETE /_matrix/client/v3/user/{userId}/account_data/{type} -DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} +DELETE /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} ``` These, respectively, removes account-wide account data, and room-scoped account data. From 88f7f7cf824e6f6e39eed0359b7808dba875284b Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Fri, 15 Apr 2022 19:56:49 +0000 Subject: [PATCH 07/15] add backwards compat note --- proposals/3391-account-data-delete.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 9ce99e2f02f..489c06c46d8 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -80,6 +80,16 @@ If, for some reason, an event type exists in both `account_data.events` and `acc Full-state syncs must not include `.removed_events`, but consequently clients must see anything in `events` as replacing what existed previously. +#### Backwards Compatibility Note + +Server implementations **may** include an empty (`{}`) `events` entry for deleted account data, +together with an entry in `removed_events`. + +This is for backwards compatibility, as clients may or may not understand the `removed_events` key. + +*The author thinks that this should only be necessary for a single matrix version, +as clients adapt, but the SCT can - of course - have differing opinions.* + ## Potential issues Desync is possible, and so if there's a situation where the client has a different view on account From da1328a69552697ddf33ba14d406790fea187874 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Sun, 22 May 2022 14:52:29 +0000 Subject: [PATCH 08/15] address review feedback --- proposals/3391-account-data-delete.md | 36 ++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 489c06c46d8..a5b84a19ab5 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -66,29 +66,34 @@ Account Data changes are announced through sync, this proposal also aims to add ``` -Providing an optional `removed_events` key per every `account_data` object, -containing an array which references the deleted account-data types. +Providing an optional `removed_events` key per every `account_data` object, containing an array +which references the deleted account-data types. -These are the tags that were removed since `since` and `next_batch`, if `since` is specified and valid. +These are the tags that were removed since `since` and `next_batch`, if `since` is specified and +valid. -If between `since` and `next_batch` the account data has been deleted and re-created, this field shouldn't exist, -and data should be just put in `account_data.events` as if it's a normal change/creation. +If between `since` and `next_batch` the account data has been deleted and re-created, this field +shouldn't exist, and data should be just put in `account_data.events` as if it's a normal +change/creation. -If, for some reason, an event type exists in both `account_data.events` and `account_data.removed_events`, the reference in -`.removed_events` must be ignored. +If, for some reason, an event type exists in both `account_data.events` and +`account_data.removed_events`, the reference in `.removed_events` must be ignored. -Full-state syncs must not include `.removed_events`, but consequently clients must see anything -in `events` as replacing what existed previously. +Requests to `/sync` without a `since` token must not include `.removed_events`. Consequently, +anything present in `events` represents a full state of account data, and anything missing (from a +previous `since`-less sync) must be removed from the client's cache. #### Backwards Compatibility Note -Server implementations **may** include an empty (`{}`) `events` entry for deleted account data, -together with an entry in `removed_events`. +When a server announces it supports any version that does not include this MSC (via `/versions`), it +**must** include an empty (`{}`) `events` entry for deleted account data (per sync), together with +the entry in `removed_events`. -This is for backwards compatibility, as clients may or may not understand the `removed_events` key. +This is done for backwards compatibility reasons, as clients may or may not understand the +`removed_events` key when communicating with this server. -*The author thinks that this should only be necessary for a single matrix version, -as clients adapt, but the SCT can - of course - have differing opinions.* +*This author believes that any matrix client will act responsibly when encountering a server +supporting only matrix versions it does not understand, and fail-fast if this is the case.* ## Potential issues @@ -112,6 +117,3 @@ DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/rooms/{roomId}/ ``` And `org.matrix.msc3391.removed_events` for `account_data` sync. - -**Note:** As this operation would be largely "unknown" to clients, -cache invalidation problems could occur as clients could aggressively cache account data. \ No newline at end of file From 333264fbe1d2ec8044d6c89ffe71cd1319d55a34 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 20 Oct 2022 13:40:39 +0200 Subject: [PATCH 09/15] Address feedback --- proposals/3391-account-data-delete.md | 116 ++++++++++---------------- 1 file changed, 42 insertions(+), 74 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index a5b84a19ab5..6c17059b610 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -1,114 +1,82 @@ # MSC3391: Deleting account data +Currently, in Matrix, there is no semantic way to "remove" or "delete" account data. There is only a +method to create and update it, them being effectively the same operation, but no method to "remove" +it. + +This violates the CRUD principle, and disallows "cleaning up" account data, or de-reference certain +keys used for certain actions, as then they will stay around forever. + ## Proposal +This proposal aims to: +- Define "`{}`" account data content as effectively "deleted", alongside out-of-band deletion semantics. +- Allow `DELETE` HTTP methods on account data endpoints to perform the deletion. + +The first, defining `{}` as "deleted", is to codify this defacto "nullification" into the spec as +expected behavior for deletion. This paves the way for better client interpretation of that data, +and would allow backwards compatibility when clients do `PUT` `{}` as account data. (More on this in +the dedicated section) + ### Endpoints -Account data and room data currently have the following endpoints; +Account data and room data currently have the following endpoints: +Global Account Data, +[`GET`](https://spec.matrix.org/v1.4/client-server-api/#get_matrixclientv3useruseridaccount_datatype) +and +[`PUT`](https://spec.matrix.org/v1.4/client-server-api/#put_matrixclientv3useruseridaccount_datatype): ``` GET /_matrix/client/v3/user/{userId}/account_data/{type} PUT /_matrix/client/v3/user/{userId}/account_data/{type} +``` +And Room-specific Account Data, +[`GET`](https://spec.matrix.org/v1.4/client-server-api/#get_matrixclientv3useruseridroomsroomidaccount_datatype) +and +[`PUT`](https://spec.matrix.org/v1.4/client-server-api/#put_matrixclientv3useruseridroomsroomidaccount_datatype): +``` GET /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} PUT /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} ``` -This proposal aims to add the following two endpoints (with no body); - +This proposal aims to add the following two endpoints (with no request body): ``` DELETE /_matrix/client/v3/user/{userId}/account_data/{type} DELETE /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} ``` -These, respectively, removes account-wide account data, and room-scoped account data. +These, respectively, remove account-wide account data, and room-scoped account data. -### Sync +#### Deleted account data responses -Account Data changes are announced through sync, this proposal also aims to add the following to sync; - -```json5 - -{ - // ... - "account_data": { - "events": [ - { - // ... - } - ], - "removed_events": ["m.direct", "m.push_rules"] // <- NEW - }, - // ... - "rooms": { - "join": { - - "!this-is-a-room:example.com": { - // ... - "account_data": { - "events": [ - { - // ... - } - ], - "removed_events": ["m.tag", "m.fully_read"] // <- NEW - } - // ... - }, - - } - }, - // ... -} +Furthermore, when a client deletes account data, it must expect `/account_data/` to return a 404 on +the next request. -``` +#### Backwards Compatibility -Providing an optional `removed_events` key per every `account_data` object, containing an array -which references the deleted account-data types. +For backwards compatibility reasons, if a client `PUT`s `{}` for account data, that must be seen +equivalent as `DELETE`-ing that account data. -These are the tags that were removed since `since` and `next_batch`, if `since` is specified and -valid. - -If between `since` and `next_batch` the account data has been deleted and re-created, this field -shouldn't exist, and data should be just put in `account_data.events` as if it's a normal -change/creation. - -If, for some reason, an event type exists in both `account_data.events` and -`account_data.removed_events`, the reference in `.removed_events` must be ignored. - -Requests to `/sync` without a `since` token must not include `.removed_events`. Consequently, -anything present in `events` represents a full state of account data, and anything missing (from a -previous `since`-less sync) must be removed from the client's cache. - -#### Backwards Compatibility Note - -When a server announces it supports any version that does not include this MSC (via `/versions`), it -**must** include an empty (`{}`) `events` entry for deleted account data (per sync), together with -the entry in `removed_events`. - -This is done for backwards compatibility reasons, as clients may or may not understand the -`removed_events` key when communicating with this server. +### Sync -*This author believes that any matrix client will act responsibly when encountering a server -supporting only matrix versions it does not understand, and fail-fast if this is the case.* +Account Data changes are announced through sync, this proposal also aims to change this response slightly after account data deletion. -## Potential issues +In `account_data.events` and `rooms.join.{room_id}.account_data.events`, a client must interpret +`{}` for an event content as it being deleted. -Desync is possible, and so if there's a situation where the client has a different view on account -data than the server, it should query the account data wherever possible. +This must happen only on syncs with a `since` token. ## Security considerations No considerable security problems, other than the fact that a user can potentially delete important data. -Though, for the purposes of this proposal, that is seen as a proper feature of CRUD :) - ## Unstable prefix -When implementing this proposal, servers should use the `org.matrix.msc3391` unstable prefix; +When implementing this proposal, servers should use the `org.matrix.msc3391` unstable prefix: ``` DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/account_data/{type} @@ -116,4 +84,4 @@ DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/account_data/{t DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/rooms/{roomId}/account_data/{type} ``` -And `org.matrix.msc3391.removed_events` for `account_data` sync. +The `unstable_features` key for this MSC is `org.matrix.msc3391`. From ae1785ab69d37ce4d8280710110b0e8c017f2aa0 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 20 Oct 2022 17:12:14 +0200 Subject: [PATCH 10/15] Add idempotency note --- proposals/3391-account-data-delete.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 6c17059b610..63d266a511c 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -51,6 +51,8 @@ DELETE /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} These, respectively, remove account-wide account data, and room-scoped account data. +For idempotency reasons, these endpoints always return `200 OK`, with an empty JSON body `{}`. + #### Deleted account data responses Furthermore, when a client deletes account data, it must expect `/account_data/` to return a 404 on From 75b1adea0e640aebb6158ad44d7c509d7bdf4257 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Fri, 25 Nov 2022 19:10:19 +0100 Subject: [PATCH 11/15] Update proposals/3391-account-data-delete.md Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- proposals/3391-account-data-delete.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 63d266a511c..35a1d427374 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -55,7 +55,7 @@ For idempotency reasons, these endpoints always return `200 OK`, with an empty J #### Deleted account data responses -Furthermore, when a client deletes account data, it must expect `/account_data/` to return a 404 on +Furthermore, when a client deletes account data, it must expect the `GET` methods above to return a 404 on the next request. #### Backwards Compatibility From edc0d5454eb7cbec35e84b50136a5481010c368d Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Wed, 10 May 2023 20:21:11 +0200 Subject: [PATCH 12/15] address misc review comments --- proposals/3391-account-data-delete.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 35a1d427374..10e22ff866f 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -53,6 +53,8 @@ These, respectively, remove account-wide account data, and room-scoped account d For idempotency reasons, these endpoints always return `200 OK`, with an empty JSON body `{}`. +For any account data key that cannot be set (like `m.fully_read`), the delete API will have a likewise error response. + #### Deleted account data responses Furthermore, when a client deletes account data, it must expect the `GET` methods above to return a 404 on @@ -86,4 +88,6 @@ DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/account_data/{t DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/rooms/{roomId}/account_data/{type} ``` -The `unstable_features` key for this MSC is `org.matrix.msc3391`. +The `unstable_features` key for this MSC is `org.matrix.msc3391`, it has to be set to `true`. + +Any other value or absence of this key will signal the absence of support for this feature. From 7516cf6365624f06f7492c3e88e30073faba4415 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 15 Jun 2023 13:13:52 +0200 Subject: [PATCH 13/15] More authoritative messaging Co-authored-by: Travis Ralston --- proposals/3391-account-data-delete.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index 10e22ff866f..a3232d277a2 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -42,7 +42,7 @@ GET /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} PUT /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type} ``` -This proposal aims to add the following two endpoints (with no request body): +This proposal adds the following two endpoints (with no request body): ``` DELETE /_matrix/client/v3/user/{userId}/account_data/{type} From e2fce0a02f8b2a6ec07390ba342f1d533d46168c Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 15 Jun 2023 13:18:00 +0200 Subject: [PATCH 14/15] comma -> semicolon Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- proposals/3391-account-data-delete.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index a3232d277a2..bc602c347f4 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -67,7 +67,7 @@ equivalent as `DELETE`-ing that account data. ### Sync -Account Data changes are announced through sync, this proposal also aims to change this response slightly after account data deletion. +Account Data changes are announced through sync; this proposal also aims to change this response slightly after account data deletion. In `account_data.events` and `rooms.join.{room_id}.account_data.events`, a client must interpret `{}` for an event content as it being deleted. From 0653f3468242c0fe18d90a16794c1488d30f54f2 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Thu, 13 Jul 2023 09:45:16 +0000 Subject: [PATCH 15/15] address review feedback --- proposals/3391-account-data-delete.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/proposals/3391-account-data-delete.md b/proposals/3391-account-data-delete.md index bc602c347f4..e6533f4157c 100644 --- a/proposals/3391-account-data-delete.md +++ b/proposals/3391-account-data-delete.md @@ -55,6 +55,8 @@ For idempotency reasons, these endpoints always return `200 OK`, with an empty J For any account data key that cannot be set (like `m.fully_read`), the delete API will have a likewise error response. +These endpoints are authenticated, and can be rate-limited. + #### Deleted account data responses Furthermore, when a client deletes account data, it must expect the `GET` methods above to return a 404 on @@ -69,10 +71,16 @@ equivalent as `DELETE`-ing that account data. Account Data changes are announced through sync; this proposal also aims to change this response slightly after account data deletion. -In `account_data.events` and `rooms.join.{room_id}.account_data.events`, a client must interpret -`{}` for an event content as it being deleted. +On incremental syncs (sync with `since`), in paths `account_data.events` and `rooms.join.{room_id}.account_data.events`, +a `{}` for event content must be interpreted as a deletion by the client. + +These only occur in incremental syncs. An initial sync (without `sync`) must never contain keys with content `{}`, +even if the delete has just occurred. + +## Alternatives -This must happen only on syncs with a `since` token. +Instead of sending down deletions through `.events` as `{}`, we could use a new `.deleted_events` +to send down the keys of deleted events. ## Security considerations