Skip to content

MSC4262: Sliding Sync Extension: Profile Updates - #4262

Open
tcpipuk wants to merge 10 commits into
matrix-org:mainfrom
tcpipuk:patch-2
Open

tcpipuk wants to merge 10 commits into
matrix-org:mainfrom
tcpipuk:patch-2

Conversation

@tcpipuk

@tcpipuk tcpipuk commented Feb 3, 2025 •

Copy link
Copy Markdown
Contributor

Rendered

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


Known Implementations:

  • Clients:
    • Element X
  • Servers:
    • Synapse

@clokep clokep added proposal A matrix spec change proposal. Process state. A-Client Server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Feb 3, 2025

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.

Implementation requirements:

  • Client
  • Server

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.

Implementation authors should be aware that their implementations (especially Synapse) may currently differ from the accepted underlying MSC4186: Simplified Sliding Sync document contents. See the bottom of that MSC for a list of implementation differences.

This MSC is written against the accepted version of MSC4186's definition of sliding sync.

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.

Synapse implementation: element-hq/synapse#20003

Comment thread proposals/4262-sliding-sync-profiles.md
Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md Outdated

@anoadragon453 anoadragon453 left a comment

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.

@tcpipuk would you be opposed to myself taking over updating and maintaining this MSC? Element are currently looking to implement it as part of our work on MSC4426: User Status Profile Fields.

Comment thread proposals/4262-sliding-sync-profiles.md Outdated

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.

Implementation authors should be aware that their implementations (especially Synapse) may currently differ from the accepted underlying MSC4186: Simplified Sliding Sync document contents. See the bottom of that MSC for a list of implementation differences.

This MSC is written against the accepted version of MSC4186's definition of sliding sync.

Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md Outdated
@tcpipuk

tcpipuk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the offer, @anoadragon453 - I've let this one lapse because of a lot of life events over the last 12 months, so would be all too happy for you to shepherd this one through for Element (and the community's) benefit! 😊

Comment thread proposals/4262-sliding-sync-profiles.md Outdated
Comment thread proposals/4262-sliding-sync-profiles.md
Comment thread proposals/4262-sliding-sync-profiles.md
Comment thread proposals/4262-sliding-sync-profiles.md
Comment thread proposals/4262-sliding-sync-profiles.md
The previous wording was alluding to the fact that the field isn't "sticky". But readers probably won't have that
assumption anyways, so let's just remove it.
{
// extensions is a top-level field in the response body.
"extensions": {
"profiles": {

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.

It's the dreaded question again: is there going to be any pagination, so the server doesn't send unboundedly large responses here? If so, how will it work?
matrix-org/matrix-spec#2378

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 don't believe there's any reason an HS couldn't split a profile with many fields up into several sync responses: I don't think there's any meaning attached to them arriving together or separately. Each field should be small.

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.

Feels like pagination should work similarly to how existing implementations are handling it, for example thread subscriptions / MSC4308.

Comment on lines +33 to +34
The `fields` parameter is optional. If omitted, *all* profile fields will be in
scope.

@anoadragon453 anoadragon453 Jul 22, 2026 •

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.

Note that this differs from the semantics of the profile_fields.ids parameter of MSC4429, where omitting the parameter means no profile fields will be in scope.

The goal is to not suddenly start sending profile fields to legacy clients. Instead, they must opt-in. In legacy sync, that opt-in is done by providing the profile_fields.ids parameter. In sliding sync, clients opt-in to extensions via setting their *.enabled boolean. From there, all other parameters assume the client wants profile fields.

Therefore, if we defined an omitted fields parameter to mean "no profile updates" (like in MSC4429), you'd have:

{
    "enabled": true
}

which wouldn't result in any fields being sent down. And that's practically useless. So instead we define it as "all fields".

I don't have a good use case for "receive updates to all known profile fields" yet, as clients will usually only want to receive updates for the fields they've built UI for already.

Perhaps if you're looking at a user's profile, showing all set fields, even unknown ones, and you want that UI to update in real time? 🤷 Interested in anyone has any other use cases.

jaywink added a commit to element-hq/synapse that referenced this pull request Aug 25, 2026
This PR implements support for profile updates over Sliding Sync:
matrix-org/matrix-spec-proposals#4262. This pr
may be easier to review as a whole than commit by commit.

This builds on the legacy sync profile updates feature
#19556, specifically the
profile updates stream it added.

Submitting for early review to get consensus on implementation. There
are some things we would like to add still, from spec, mainly:

* > Homeservers should only consider a profile field update "accepted"
by a client
> once the client returns with a new /sync request with the next /sync
token,
> NOT just after sending down the profile update. The client may never
receive
> response due to network conditions, or a bug in the client
implementation.
* > When a room enters this subset in this connection for the first
time, all requested
> fields from profiles of users in that room MAY be sent down. This
gives the client
> a base set of information for which future field updates can be
applied on top of.
> The homeserver MAY omit some fields and profiles if it believes that
the client has
> already received them, likewise repeat profiles MAY be sent down based
on homeserver
  > implementation.
* > Finally, if the list of fields expands to cover a new field ID,
those fields should
> be sent down for all users that are within the current room subset.
Future incremental
  > updates will then include changes to this field.
* Additionally, we would need to implement a lazy loading cache similar
to the legacy sync. (not part of MSC as such)

Depending on review these could either be added to this pr, or to keep
this pr from not growing too much, be added in a follow-up pr, as they
are more enhancement to this base sliding sync profile updates
functionality than a part of the core functionality.

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
  - Use markdown where necessary, mostly for `code blocks`.
  - End with either a period (.) or an exclamation mark (!).
  - Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Olivier 'reivilibre' <olivier@librepush.net>
Co-authored-by: Olivier 'reivilibre <oliverw@element.io>

@nyphong39-svg nyphong39-svg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tcpipuk:patch-2

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Sep 5, 2026
Tested on NetBSD 10 amd64 with 2026Q2 environment.

# Synapse 1.160.0 (2026-09-02)

## Features

- Add experimental support for [MSC4502](matrix-org/matrix-spec-proposals#4502): Targeted and unrestricted room member queries. ([\#19974](element-hq/synapse#19974))
- Add optional support for [MSC4262: Profile Updates for Sliding Sync](matrix-org/matrix-spec-proposals#4262).
  Currently defaults to disabled, and is limited to local users only for the sync results. ([\#20003](element-hq/synapse#20003))
- Allow specifying multiple `action_name` and `status` query parameters when listing scheduled tasks via the admin API. ([\#20067](element-hq/synapse#20067))

# Synapse 1.159.0 (2026-08-18)

## Features

- Add optional support for [MSC4429: Profile Updates for Legacy Sync](matrix-org/matrix-spec-proposals#4429).
  Currently defaults to not enabled, and is limited to local users only for the sync results. ([\#19556](element-hq/synapse#19556))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Client Server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal. Process state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants