-
Notifications
You must be signed in to change notification settings - Fork 423
MSC4168: Update m.space.* state on room upgrade
#4168
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Matthias Ahouansou <matthias@ahouansou.cz>
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:
- Server
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.
continuwuity has a complete implementation of this MSC: https://forgejo.ellis.link/continuwuation/continuwuity/pulls/907
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.
Synapse has a partial implementation (it copies m.space.child): element-hq/synapse@63f28e4
| if there is a use-case for not updating events in other rooms. If there is one, then a query parameter can | ||
| be added to toggle this feature. | ||
|
|
||
| ## Alternatives |
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.
MSC3385 seems to mention spaces but doesn't really make a proposal. 🤷
| @@ -0,0 +1,46 @@ | |||
| # MSC4168: Update `m.space.*` state on room upgrade | |||
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.
It's unclear to me if we want to be more prescriptive in the room upgrade process: matrix-org/matrix-spec#1906 exists for discussion.
| When a [room upgrade](https://spec.matrix.org/v1.11/client-server-api/#room-upgrades) is performed, | ||
| many state events are copied over to the new room, to minimize the amount of work the user has to do | ||
| after the upgrade. However, the spec doesn't currently recommend that `m.space.child` or `m.space.parent` | ||
| be copied over, as well as these events being updated in other rooms. |
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.
I don't agree that this is a good solution - infact, copying far too much stuff is exactly why I avoid the entire upgrade endpoint in all circumtances, and manage tombstones/creation myself... I would be more interested in making the entire copy events thing opt-in instead (and configurable via passing either a list of event IDs or type/key pairs to replicate, or a DSL to pick and transform items...)
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.
I think that would be better suited in another MSC (however, this (your) suggestion has it's own issues, e.g. especially the first bullet point here, but all of them apply to some extent).
|
MSCs proposed for Final Comment Period (FCP) should meet the requirements outlined in the checklist prior to being accepted into the spec. This checklist is a bit long, but aims to reduce the number of follow-on MSCs after a feature lands. SCT members: please check off things you check for, and raise a concern against FCP if the checklist is incomplete. If an item doesn't apply, prefer to check it rather than remove it. Unchecking items is encouraged where applicable. MSC authors: feel free to ask in a thread on your MSC or in the#matrix-spec:matrix.org room for clarification of any of these points.
|
|
Team member @mscbot has proposed to merge this. The next step is review by the rest of the tagged people: Concerns:
Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for information about what commands tagged team members can give me. |
| When a room upgrade is performed, servers SHOULD replicate `m.space.child` and `m.space.parent` state | ||
| in the new room. | ||
|
|
||
| In addition, `m.space.child` and `m.space.parent` events in other rooms, where the caller of `/upgrade` |
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.
Note that rooms can also be upgraded by sending an m.room.tombstone into the room. We shouldn't exclude copying over state events in this case, just because the user didn't use /upgrade.
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.
👍 For more context on this point, there is a recent case in Synapse where we don't handle this kind of thing.
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.
I don't think that's an 'upgrade' necessarily though? I'm not sure servers should be doing special logic in that case.
You might send a tombstone to redirect to a different room or "close" it.
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.
We historically have not considered manually sending tombstones as "upgrades" in the protocol. The spec wants callers to perform upgrades using the endpoint, not by sending events manually.
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.
There is some nuance here.
The whole problem is that from the remote homeservers perspective, it doesn't matter whether you've used the /upgrade endpoint or not. It just looks like a m.room.tombstone was put in the room either way.
In the case I mentioned around push rules and where I think @anoadragon453's point is spawning from, I think it does make sense to copy push rules over whenever the homeserver notices the room was upgraded (m.room.tombstone and new room has a predecessor). Copying push rules is something that can only be done by the local homeserver for the user. And it doesn't make sense to handle this for remote rooms but not local rooms. This kind of discussion is probably why that clarification probably deserves it's own MSC.
(same with copying over local aliases and room tags) -- Anything that the local homeserver has to do.
Whereas in this case, a local homeserver doesn't need to take any action about space state in the room when it notices a m.room.tombstone. All of the action is from the person doing the "upgrade" (or sending the state) and can manually transfer state as they see fit.
In shorter words, I don't think we should copy over m.space.child or m.space.parent when a m.room.tombstone event is sent.
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.
Does this need to be documented as a potential issue?
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.
Not in this case.
Generally, this is something to keep in mind with proposals for room upgrade behaviors though. My reply above explains the nuance.
Co-authored-by: Andrew Morgan <anoadragon453@users.noreply.github.com>
|
I don't actually know what thread this concern is attached to, so resolving: @mscbot resolve TravisR - Decide to either always update children of spaces, never update, or leave it as an implementation detail (my preferred choice) (if it is attached to a thread, I'm not sure it's so important to block FCP anyway) |
Looks like it would be attached to #4168 (comment) |
|
@mscbot concern Lack of details about updating references to replaced room |
…e `via` field of previous space events optional
| - For `m.space.parent` events, a new `m.space.parent` event with `state_key` set to the new room's | ||
| ID should be sent. If the | ||
| space event pointing to the room to be upgraded has `canonical` set to `true` in `content`, | ||
| homeservers SHOULD update that space event to set `canonical` to `false`, while setting it to | ||
| `true` in the space event pointing to the new room. |
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.
For parent space events, wouldn't it just get copied to the new room with the same state key? Or is the room being upgraded the parent space?
This all sounds simple but gets complicated. Maybe we can have some examples?
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.
This is talking about space members (when space parents are being upgraded), since the space parent itself won't have any m.space.parent state (unless it is a member of a space itself). I will add examples though.
Rendered
Implementations:
m.space.childto the new room): element-hq/synapse@63f28e4SCT Stuff:
FCP tickyboxes
MSC checklist