Skip to content

s2s/query: clarify profile behaviour and API responses#2326

Open
famfo wants to merge 2 commits intomatrix-org:mainfrom
famfo:s2s-profile
Open

s2s/query: clarify profile behaviour and API responses#2326
famfo wants to merge 2 commits intomatrix-org:mainfrom
famfo:s2s-profile

Conversation

@famfo
Copy link
Copy Markdown
Contributor

@famfo famfo commented Mar 2, 2026

Since the existing specification of the behavior is relatively fuzzy, I have chosen the stricter interpretations from multiple places saying something similar.

Pull Request Checklist

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

@famfo famfo requested a review from a team as a code owner March 2, 2026 00:42
Comment on lines 142 to 144
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While we are touching this endpoint, I believe that we should remove this enum definition, because it shows as:

One of: [displayname, avatar_url].

But with extended profile fields, more values are possible.

Comment on lines +167 to +168
The display name of the user. MUST either be omitted or set to `null` if
the user does not have a display name set.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside: I was a bit surprised by this, but then I found d914c40, and this seems to be just a clarification of that changes.

richvdh
richvdh previously approved these changes Mar 10, 2026
Copy link
Copy Markdown
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

LGTM

@richvdh richvdh requested review from zecakeh and removed request for zecakeh March 11, 2026 10:26
@turt2live turt2live requested a review from richvdh March 17, 2026 01:21
@turt2live
Copy link
Copy Markdown
Member

@richvdh it's not clear to me if this is ready to merge or not

@richvdh
Copy link
Copy Markdown
Member

richvdh commented Mar 17, 2026

sorry, I thought it was, but then I saw the requests from @zecakeh for further changes

@richvdh richvdh removed request for richvdh and zecakeh March 17, 2026 10:08
@richvdh richvdh dismissed their stale review March 17, 2026 10:09

more changes needed

Signed-off-by: famfo <famfo@famfo.xyz>
@richvdh
Copy link
Copy Markdown
Member

richvdh commented Mar 31, 2026

@famfo please don't force-push between rounds of review: it makes it very hard to see what has changed since the previous round.

Comment on lines +119 to +123
- allow users to set arbitrary key/value pairs in their profile in addition to the
specified pairs
- deny profile look-up over federation by responding with 403 and an error code of
`M_FORBIDDEN`
- omit certain key/value pairs in the response
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Per https://github.com/matrix-org/matrix-spec/blob/main/meta/documentation_style.rst#general:

Suggested change
- allow users to set arbitrary key/value pairs in their profile in addition to the
specified pairs
- deny profile look-up over federation by responding with 403 and an error code of
`M_FORBIDDEN`
- omit certain key/value pairs in the response
- Allow users to set arbitrary key/value pairs in their profile in addition to the
specified pairs.
- Deny profile look-up over federation by responding with 403 and an error code of
`M_FORBIDDEN`.
- Omit certain key/value pairs in the response.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this endpoint talking about setting data? Shouldn't that only be the CS docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To set expectations for requesting servers. A server doesn't have to implement the c2s API.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@clokep leaving this thread open for you to assess if you're satisfied with the answer. I agree it's not terribly clear as written here but I think it's an improvement over the current spec and I don't have any immediate suggestions for improvements.

Comment on lines +176 to +179
m.tz:
type: string
description: The name of the user's time zone. The name MUST be registered in
the [IANA Time Zone Database](https://www.iana.org/time-zones).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be good to give this an x-addedInMatrixVersion tag. Since m.tz was added in spec v1.16 (it looks like this change got forgotten in #2206), we should probably set it to "1.16".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should the other fields also get a x-addedInMatrixVersion: "1.16"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

well no, because they haven't been newly added to the spec?

Comment on lines +153 to +154
matching field MUST included in the response. If no `field` was specified,
the response MUST include the fields of the user's profile that can be made
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there's some missing words:

Suggested change
matching field MUST included in the response. If no `field` was specified,
the response MUST include the fields of the user's profile that can be made
matching field MUST be included in the response. If no `field` was specified,
the response MUST include all of the fields of the user's profile that can be made

I'm still not sure about the fist sentence. I think you're trying to say "the response MUST only include that field", but I can't make that change as a suggestion.

@richvdh richvdh self-requested a review April 7, 2026 10:50
m.tz:
type: string
description: The name of the user's time zone. The name SHOULD be registered in
the [IANA Time Zone Database](https://www.iana.org/time-zones), requesting
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comma splice

Suggested change
the [IANA Time Zone Database](https://www.iana.org/time-zones), requesting
the [IANA Time Zone Database](https://www.iana.org/time-zones). Requesting

the response should include the fields of the user's profile that can be made
public, such as the display name and avatar.
The profile for the user. If a `field` is specified in the request, the response
MUST only included the specified `field`. If no `field` was specified, the response
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
MUST only included the specified `field`. If no `field` was specified, the response
MUST only include the specified `field`. If no `field` was specified, the response

public, such as the display name and avatar.
The profile for the user. If a `field` is specified in the request, the response
MUST only included the specified `field`. If no `field` was specified, the response
SHOULD include all of the fields of the user's profile, which can be made public.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't mean what you want it to mean. In any case, why have you removed the examples of display name and avatar?

Suggested change
SHOULD include all of the fields of the user's profile, which can be made public.
SHOULD include all of the fields of the user's profile that can be made
public, such as the display name and avatar.

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.

6 participants