-
Notifications
You must be signed in to change notification settings - Fork 417
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 <[email protected]>
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. 🤷
| has the permission to do so, servers SHOULD send a new state event for the old room, removing the `via` field | ||
| from it, and send a new event of the same type, with `state_key` being the new room ID, and `via` just |
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 you want to keep the old m.space.child events and just add the upgraded one so that upgraded rooms properly appear in the right space? I'd be curious of the algorithm that Element Web uses when you upgrade 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.
The reason I didn't want to keep the old m.space.child event is because otherwise in the space you would see both the old and upgraded room, likely leading to confusion due to them both having the same icon, description, name, etc.
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.
The alternative is that the old room then gets kicked "out" of the space, which I think is more confusing? Element clients don't show rooms which are upgraded if you're also in the upgraded room, I'm unsure how common that is in clients though.
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.
AFAIK Element is the only client to do this. Personally I haven't seen anyone confused about kicking old rooms out of the space when I have done upgrades, so I'm not sure whether that's true or not.
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.
Also, I think Element would still display both rooms if you are in neither the old or new room, since it wouldn't be able to know that one was an upgrade of the other.
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.
The other problem with doing this is it prevents future people from joining if it uses restricted (inherited) m.room.join_rules.
I also created a dedicated spec issue around this problem: matrix-org/matrix-spec#2194
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 can be instead addressed by adding m.room.tombstone to the list of recommended stripped state events.
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.
Sorry, I meant adding room upgrade details to room summaries/space hierarchies, but the above is something that should probably be done anyways.
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'd suggest leaving whether to kick the children out of the space to the implementation as an implementation detail for now. It's likely that Synapse will do so, but other servers might not. If we find we need a way to control that behaviour, we can always open another MSC.
| @@ -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.
Co-authored-by: Andrew Morgan <[email protected]>
Rendered
Implementations:
m.space.childto the new room): element-hq/synapse@63f28e4SCT Stuff:
FCP tickyboxes
MSC checklist