-
Notifications
You must be signed in to change notification settings - Fork 418
MSC3391: API to delete account data #3391
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
Closed
ShadowJonathan
wants to merge
16
commits into
matrix-org:main
from
ShadowJonathan:account-data-delete
Closed
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
150b07b
initial
ShadowJonathan faacd53
rename
ShadowJonathan 1864715
more clarifications
ShadowJonathan 9c1ac3f
change approach to account_data.removed_events
ShadowJonathan 861933a
fix indentation and unstable use
ShadowJonathan cd78ac6
Merge `main` into `account-data-delete`
ShadowJonathan 60b1bd3
the future is now, old man
ShadowJonathan 88f7f7c
add backwards compat note
ShadowJonathan da1328a
address review feedback
ShadowJonathan 333264f
Address feedback
ShadowJonathan ae1785a
Add idempotency note
ShadowJonathan 75b1ade
Update proposals/3391-account-data-delete.md
ShadowJonathan edc0d54
address misc review comments
ShadowJonathan 7516cf6
More authoritative messaging
ShadowJonathan e2fce0a
comma -> semicolon
ShadowJonathan 0653f34
address review feedback
ShadowJonathan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # MSC3391: Deleting account data | ||
ShadowJonathan marked this conversation as resolved.
Show resolved
Hide resolved
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Proposal | ||
|
|
||
| ### Endpoints | ||
ShadowJonathan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Account data and room data currently have the following endpoints; | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ``` | ||
| 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 (with no body); | ||
|
|
||
| ``` | ||
| DELETE /_matrix/client/r0/user/{userId}/account_data/{type} | ||
|
|
||
| DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type} | ||
| ``` | ||
|
|
||
| These, respectively, removes account-wide account data, and room-scoped account data. | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Sync | ||
|
|
||
| Account Data changes are announced through sync, this proposal also aims to add the following to sync; | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```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 | ||
| } | ||
| // ... | ||
| }, | ||
|
|
||
| } | ||
| }, | ||
| // ... | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| Full-state syncs must not include `.removed_events`, but consequently clients must see anything | ||
| in `events` as replacing what existed previously. | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 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. | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## 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; | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ``` | ||
| DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/account_data/{type} | ||
|
|
||
| DELETE /_matrix/client/unstable/org.matrix.msc3391/user/{userId}/rooms/{roomId}/account_data/{type} | ||
| ``` | ||
|
|
||
| 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. | ||
ShadowJonathan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.