Skip to content

MSC4133: Update profile endpoints to support extended fields #2071

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

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

tcpipuk
Copy link

@tcpipuk tcpipuk commented Feb 14, 2025

Signed-off-by: Tom Foster tom@tcpip.uk

Pull Request Checklist

Preview: https://pr2071--matrix-spec-previews.netlify.app

@tcpipuk tcpipuk marked this pull request as ready for review February 14, 2025 10:00
@tcpipuk tcpipuk requested a review from a team as a code owner February 14, 2025 10:00
@Half-Shot
Copy link
Contributor

Could you link to matrix-org/matrix-spec-proposals#4133 in the body for easy referencing?

Copy link
Contributor

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some thoughts I had when reading though. I think largely I'm asking for a section to define the common profile keys, which may expand later when more keys make it into the spec.

But this is a great start, thanks for kicking off.

@clokep clokep requested a review from a team February 17, 2025 22:02
@zecakeh
Copy link
Contributor

zecakeh commented Feb 22, 2025

I think that this also needs at least a small sentence in the "Events on Change of Profile Information" section that other fields are not propagated through m.room.member events (and m.presence?).

@@ -0,0 +1 @@
Feature: Update profile endpoints to become generic to support [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133) extended fields. Extended profile fields are now supported via the new `m.profile_fields` capability, which deprecates the previous `m.set_avatar_url` and `m.set_displayname` capabilities. Stabilised keys are explicitly enumerated, and custom keys must conform to the Common Namespaced Identifier Grammar.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see this has gone through a bit of iteration, so apologies for the back-and-forth, but honestly this feels rather wordy for a changelog entry. Take a look at the examples in https://spec.matrix.org/v1.14/changelog/v1.14/ (and previous versions): there are very few that run to more than a single sentence; if people want more details about what's actually changing they can easily click through to the PR; and the body of the spec contains "Changed in v1.14" notes.

I think a good trick here would be to have two separate changelog entries; so here, we want something like:

Suggested change
Feature: Update profile endpoints to become generic to support [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133) extended fields. Extended profile fields are now supported via the new `m.profile_fields` capability, which deprecates the previous `m.set_avatar_url` and `m.set_displayname` capabilities. Stabilised keys are explicitly enumerated, and custom keys must conform to the Common Namespaced Identifier Grammar.
Update user profile endpoints to handle custom fields, and add a new `m.profile_fields` capability,as per [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133).

... and then in changelogs/client_server/newsfragments/2071.deprecation, we want:

Deprecate `m.set_avatar_url` and `m.set_displayname` capabilities, as per [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description: Capability to indicate if the user can change their display name.
description: |
**Deprecated:** Capability to indicate if the user can change their display name.
Please refer to `m.profile_fields` for extended profile management.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please refer to `m.profile_fields` for extended profile management.
Refer to `m.profile_fields` for extended profile management.

description: Capability to indicate if the user can change their avatar.
description: |
**Deprecated:** Capability to indicate if the user can change their avatar.
Please refer to `m.profile_fields` for extended profile management.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please refer to `m.profile_fields` for extended profile management.
Refer to `m.profile_fields` for extended profile management.

Comment on lines +104 to +105
description: List of allowed additional custom profile field keys. A `*` can be used as a
wildcard to match any sequence of characters. This list takes precedence over the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A * can be used as a wildcard to match any sequence of characters.

Wait, where did this come from? This wasn't in the MSC, was it? Wildcarding opens up a whole new set of questions that I don't think we want to deal with.

parameters:
- in: path
name: userId
description: The user whose display name to get.
description: The user whose profile field to get.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: The user whose profile field to get.
description: The user whose profile field should be returned.

and `displayname` (unless set to `null`, as they can only be strings)
plus any custom profile fields.

**Note**: The complete profile must be under 64 KiB.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I don't think this is the place to mention this.

security:
- accessTokenQuery: []
- accessTokenBearer: []
parameters:
- in: path
name: userId
description: The user whose avatar URL to set.
description: The user whose profile field to delete.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: The user whose profile field to delete.
description: The user whose profile field should be deleted.

name: userId
description: The user whose avatar URL to get.
name: keyName
description: The profile field key name to delete. It must be either
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: The profile field key name to delete. It must be either
description: The key name of the profile field to delete. It must be either

schema:
type: string
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
responses:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mea culpa, but we don't appear to have discussed as part of the MSC process what should happen if we attempt to delete a profile field which doesn't exist (should it return a 404 or a 200?)

It looks like the sample implementation returns a 200? I think it would be a good idea to spec that while we're here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants