-
Notifications
You must be signed in to change notification settings - Fork 393
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
MSC4267: Automatically forgetting rooms on leave #4267
Open
Johennes
wants to merge
2
commits into
matrix-org:main
Choose a base branch
from
Johennes:johannes/auto-forget
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+70
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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,70 @@ | ||
# MSC4267: Automatically forgetting rooms on leave | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks very sensible to me, fwiw. I don't think we need further proof of implementation between 2x servers, given it's also pretty trivial to envisage how it'd work; I suggest we FCP it. |
||
|
||
Matrix discriminates between "leaving" and "forgetting" a room. | ||
[`/_matrix/client/v3/rooms/{roomId}/leave`] stops a user participating in a room | ||
but still allows them to retrieve history. A subsequent call to | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`] then stops the user from being able | ||
to retrieve history. | ||
|
||
Clients don't always differentiate these two operations in their UI and may only | ||
offer leaving without forgetting a room. Thus, some servers automatically forget | ||
rooms when a user leaves them in order to more aggressively free up their | ||
resources. One example of this is the [`forget_rooms_on_leave`] config option in | ||
Synapse. | ||
|
||
The present proposal seeks to standaradize this proprietary behaviour. | ||
|
||
## Proposal | ||
|
||
When a user leaves a room, either through | ||
[`/_matrix/client/v3/rooms/{roomId}/leave`] or by being kicked or banned, | ||
Servers MAY automatically forget the room – as if the user had called | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`] themselves. | ||
|
||
This can limit clients' options to maintain an archive of historic rooms (such | ||
that they have left *without* forgetting them). Therefore, servers that | ||
auto-forget rooms MUST advertise that they do so via an `m.forget_forced_upon_leave` | ||
capability. | ||
|
||
``` json5 | ||
{ | ||
"capabilities": { | ||
"m.forget_forced_upon_leave": { | ||
"enabled": true | ||
} | ||
} | ||
} | ||
``` | ||
|
||
A value of `true` means that the server performs auto-forget so that the client | ||
cannot leave rooms without also forgetting them. A value of `false` means that | ||
rooms will only be forgotten when the clients calls | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`]. | ||
|
||
When the capability is missing, clients SHOULD assume that the server does not | ||
auto-forget. | ||
|
||
## Potential issues | ||
|
||
None. | ||
|
||
## Alternatives | ||
|
||
None. | ||
|
||
## Security considerations | ||
|
||
None. | ||
|
||
## Unstable prefix | ||
|
||
While this proposal is unstable, clients should refer to | ||
`m.forget_forced_upon_leave` as `org.matrix.msc4267.forget_forced_upon_leave`. | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
[`/_matrix/client/v3/rooms/{roomId}/leave`]: https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3roomsroomidleave | ||
[`/_matrix/client/v3/rooms/{roomId}/forget`]: https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3roomsroomidforget | ||
[`forget_rooms_on_leave`]: https://github.com/element-hq/synapse/blob/12dc6b102f071eb2eb84f2cff4cf92903276ffbb/synapse/config/room.py#L88 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation requirements:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Server: element-hq/synapse#18196
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client: matrix-org/matrix-js-sdk#4732
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conduwuit server implementation:
girlbossceo/conduwuit@35981d5
girlbossceo/conduwuit@c8a730c