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.
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
MSC3189: Per-room/per-space profiles #3189
base: old_master
Are you sure you want to change the base?
MSC3189: Per-room/per-space profiles #3189
Changes from 6 commits
4fd6f1a
7d01509
2479921
d1aa8d3
a77d7ae
96c8c03
fb6c4a2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Thinking about this further, I realised that we may be doubling down on what's effectively a major design flaw in Matrix today: that setting a profile scales O(N) with the number of rooms you are in. For instance, I just saw someone take 3 minutes to change their displayname because they were in a few hundred rooms :( - see also https://github.com/matrix-org/matrix-doc/issues/3194 and matrix-org/synapse#1297
I wonder if we should fix this first (and then make it support per-room/space semantics at the same time) rather than further entrenching the current misdesign. This could also be interesting in terms of simplifying lazy loading, as currently the main reason to LL membership events at all is so the timeline has the profile details to render their messages correctly.
One slightly crazy solution could be to switch to portable identities (a la MSC #2787 or MSC #1228), where each user has a different user ID in every room. Then, each per-room user ID could legitimately publish on their extensible profile (MSC #1769) a pointer to their displayname/avatar, and we never have to set these per room at all.
A simpler idea (which doesn't improve LL, and is more aligned with this specific MSC) would be to have the membership events reference a profile room for the profile data rather than a literal displayname/avatar. You could point it to whatever persona's profile room you like, and then by changing the profile there, it'd propagate everywhere. You could avoid impersonation by having the personae profile room say which mxid the personae is intended for. For instance, my
m.room.member
event could have anm.profile: !ara4npr0fil3:matrix.org
, and that room could have a state event ofm.displayname: ara4n
. This then gives us per-space profiles fairly easily, as it's just up to the client to select the right personae when participating in a space. However, it depends entirely on MSC #1769 and peeking (#2753 and #2444) working efficiently and nicely so that clients can calculate the right profile. Also, the act of switching persona (as opposed to renaming a persona) would still be O(N) with number of rooms affected.I don't particularly want to block this MSC on #1769 (let alone #2787), but wanted to raise this concern for completeness. If #1769 ends up ready sooner than later, I think be better to skip forward to proper personae extensible profiles rather than bodging the O(N) behaviour further.
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 doing this based on profile rooms/identities with #1769 would be very nice. As someone who's very affected by the problem you mentioned earlier (~1300 rooms, changing avatars/display names is tremendously painful). Entrenching the current misdesign (as you put it) would be something I wouldn't be very comfortable with.
A sidenote on that though: Currently we have a specific avatar and display name for each message: When we link a profile room instead, we do loose that information, because it's not in the state for that specific information anymore, right? I don't think that's a bad thing, just something we need to consider.
Last but not least: would such a change require a room version bump? The format of the m.room.member event changing doesn't really sound like a good idea to me without a room version bump, if only for the reason that we don't mix-and-match the two different variant inside one 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.
Historical profile values could be achieved by specifying timestamp ranges in the extensible profile room - ie "this persona was called Bob from 2003-2006 and then B0b from 2006-2007".
Not sure this would technically need a new room version, as it doesn't change federation and it could still be backwards compatible - but you'd need a way to tell clients that the new profiles are in use.
For this to work nicely in practice we'd need to right ensure v3 sync can lazyload the profile data without the client having to explicitly peek into all the relevant profile rooms.
(also, portable accounts are completely orthogonal to this problem, in retrospect)
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.
While reading this a thought came to mind, you could sort of half way house this, by allowing profile info in rooms to reference another room. The obvious use of this is the profiles as rooms idea discussed here, but alternatively you could instead reference the space room and just inherit your profile info in the
m.room.member
event in there?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.
@Cadair That was the thought I was playing with initially for how to improve this MSC. Though I quite liked it and was rewriting this MSC around that idea, it would preserve the O(n)-ness which I agree is a major flaw. Given that this is probably the right time to fix it being O(n), but #1769 is not quite ready, I'm not exactly sure where to go from here, as this pretty much comes down to priorities… The prospect of having native support for a #1769 solution in v3 /sync is encouraging though.
On the other hand, migrating from a system of manual propagation to a persona-room-based solution at a later date could be simple, I think? As long as both have a concept of profile scope and inheritance (which both would as I currently envision them) and the CS endpoints would look the same, I believe this would make persona rooms a natural upgrade path for when we do want to add extensible profile data and O(1) updates. @ara4n Thoughts on this course of action?
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.
Leaving it to clients makes sense when joining initially, but when updating my name/avatar it is left to the sever. My understanding is that this is to save the client from needing to send hundreds or thousands of
m.room.member
events. It seems that since the display name and avatar that you use in a room transcends clients it probably makes sense to have server support here to ensure that consistent policies can be applied.To be honest the multi-space room issue makes me uneasy. I would expect that setting my avatar in two spaces would have the same result irrespective of which order I performed the updates. I think that anything else is an unfortunate behaviour and we should try really hard to avoid 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.
Thanks for the feedback, now that I've thought it over I think I do actually want to handle these concerns in a more explicit manner.
I still believe that having one actual profile per room as part of
m.room.member
state is the way to go, given this "just works" for clients that don't care about scoped profiles, and because users could be very confused if it looks like different people are talking depending on which parent space they view a room from.However servers could certainly do more to acknowledge conflicts when they exist, by keeping explicit track of what overrides exist and what their scopes are, as you suggest. This would also very likely be necessary for proper application of inheritance policies, which I'll try to integrate into this proposal as it does seem pretty important for UX.
Will mark this as a draft until I can make the proper revisions.
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.
Thanks. I agree that putting the profile in the room makes sense. I don't think it is the only option but I think it is quite viable.
I think the key is fixing the "update" procedure. I can imagine some simple solutions such as the user has a list of profiles and where they apply. The order of the list can indicate priority and resolve conflicts. This order can potentially be generated explicitly but there is the option to adjust it when necessary. Fancy clients could warn you when setting a per-space avatar will update a room using a non-default avatar and ask you to resolve. This is a quick sketch but I think there are a number of options.
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 update procedure should now be more in line with what you're asking for, and I've added server support for inheriting on joins. This piece of feedback still stands:
…though I'm personally not sure how much value there is in solving it