|
| 1 | +# MSCXXXX: Automatically forgetting rooms on leave |
| 2 | + |
| 3 | +Matrix discriminates between "leaving" and "forgetting" a room. |
| 4 | +[`/_matrix/client/v3/rooms/{roomId}/leave`] stops a user participating in a room |
| 5 | +but still allows them to retrieve history. A subsequent call to |
| 6 | +[`/_matrix/client/v3/rooms/{roomId}/forget`] then stops the user from being able |
| 7 | +to retrieve history. |
| 8 | + |
| 9 | +Clients don't always differentiate these two operations in their UI and may only |
| 10 | +offer leaving without forgetting a room. Thus, some servers automatically forget |
| 11 | +rooms when a user leaves them in order to more aggressively free up their |
| 12 | +resources. One example of this is the [`forget_rooms_on_leave`] config option in |
| 13 | +Synapse. |
| 14 | + |
| 15 | +The present proposal seeks to standaradize this proprietary behaviour. |
| 16 | + |
| 17 | +## Proposal |
| 18 | + |
| 19 | +When a user leaves a room, either through |
| 20 | +[`/_matrix/client/v3/rooms/{roomId}/leave`] or by being kicked or banned, |
| 21 | +Servers MAY automatically forget the room – as if the user had called |
| 22 | +[`/_matrix/client/v3/rooms/{roomId}/forget`] themselves. |
| 23 | + |
| 24 | +This can limit clients' options to maintain an archive of historic rooms (such |
| 25 | +that they have left *without* forgetting them). Therefore, servers that |
| 26 | +auto-forget rooms MUST advertise that they do so via an `m.leave_without_forget` |
| 27 | +capability. |
| 28 | + |
| 29 | +``` json5 |
| 30 | +{ |
| 31 | + "capabilities": { |
| 32 | + "m.leave_without_forget": { |
| 33 | + "enabled": true |
| 34 | + } |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +A value of `false` means that the server performs auto-forget so that the client |
| 40 | +cannot leave rooms without also forgetting them. A value of `true` means that |
| 41 | +rooms will only be forgotten when the clients calls |
| 42 | +[`/_matrix/client/v3/rooms/{roomId}/forget`]. |
| 43 | + |
| 44 | +When the capability is missing, clients SHOULD assume that the server does not |
| 45 | +auto-forget. |
| 46 | + |
| 47 | +## Potential issues |
| 48 | + |
| 49 | +None. |
| 50 | + |
| 51 | +## Alternatives |
| 52 | + |
| 53 | +None. |
| 54 | + |
| 55 | +## Security considerations |
| 56 | + |
| 57 | +None. |
| 58 | + |
| 59 | +## Unstable prefix |
| 60 | + |
| 61 | +While this proposal is unstable, clients should refer to |
| 62 | +`m.leave_without_forget` as `org.matrix.mscXXXX.leave_without_forget`. |
| 63 | + |
| 64 | +## Dependencies |
| 65 | + |
| 66 | +None. |
| 67 | + |
| 68 | + [`/_matrix/client/v3/rooms/{roomId}/leave`]: https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3roomsroomidleave |
| 69 | + [`/_matrix/client/v3/rooms/{roomId}/forget`]: https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3roomsroomidforget |
| 70 | + [`forget_rooms_on_leave`]: https://github.com/element-hq/synapse/blob/12dc6b102f071eb2eb84f2cff4cf92903276ffbb/synapse/config/room.py#L88 |
0 commit comments