This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Implement MSC3391: Removing account data #14242
Labels
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Enhancement
New features, changes in functionality, improvements in performance, or user-facing enhancements.
Add an experimental implementation for MSC3391, which allows users to remove keys from their user and room account data.
TODO
Add an off-by-default experimental config option
msc3391_enabled
to guard the feature behind.Add two unstable endpoints for deleting account data:
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}
type
is removed from the user's user/room account data. This should be recorded in theaccount_data
androom_account_data
tables respectively, by setting the content of each to{}
. Ensure these entries are not included in initial syncs.Setting an account data type's content to
{}
when callingPUT /_matrix/client/v3/user/{userId}/account_data/{type}
andPUT /_matrix/client/v3/user/{userId}/rooms/{roomId}/account_data/{type}
will be equivalent to calling theDELETE
endpoint for that type. This is for backwards-compatibility with older clients which have used this to effectively "delete" keys in the past.Ensure that event entries with a content of
{}
appear down/sync
after an account data entry is deleted.Add a new table
account_data_unsynced_deletes
, which tracks whether a device has seen the deletion. Upon a delete one row for each known user device is added to this table. Upon a device sync'ing the change or hitting theGET
endpoint for the data, the relevant row will be removed. Once all devices have seen a deletion, we can delete the key from theaccount_data
orroom_account_data
tables. The device that caused the deletion should not have a row inserted.The
account_data_unsynced_deletes
table has the following schema:(stream_id, user_id, device_id)
.GET
would use the same. Deleting all rows for a device needs(user_id, device_id)
.account_data_unsynced_deletes
when a given device knows that delete has occurred. Either through/sync
orGET
endpoints.account_data_unsynced_devices
table.The text was updated successfully, but these errors were encountered: