Skip to content

MSC4262: Sliding Sync Extension: Profile Updates#4262

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

MSC4262: Sliding Sync Extension: Profile Updates#4262
tcpipuk wants to merge 4 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:
  • Servers:

@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.

Comment on lines +31 to +42
{
"users": {
"@alice:example.com": {
"displayname": "Alice",
"avatar_url": "mxc://example.com/abc123",
"org.example.language": "en-GB"
},
"@bob:example.com": {
"displayname": null // Field removal
}
}
}

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'm looking at implementing this for Element X but it isn't immediately clear to me where in the SSS response this is expected to be. Could you clarify if it is

  • as shown here and becomes a new top-level object.
  • nested within the extensions object (it seems slightly odd that the extension would be called profiles but the object returned is then called users).
  • adding the custom profile fields to an existing users e.g. if there is such a thing within rooms.

- If true, the server MAY include recent profile changes that occurred before the sync

4. On an initial sync:
- Profile data MUST only be sent for rooms returned in the sliding sync response

@pixlwave pixlwave May 28, 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.

How does this interact with the lazy_members flag? Presumably it should only return the profile data for members that have been included in the rooms response too, otherwise the initial sync could be massive if it includes e.g. matrix-hq?

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.


### Behaviour

1. The extension only returns profile updates for users who are members of rooms that the client is

@pixlwave pixlwave May 28, 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.

Out of interest, is it expected for the user's own profile to be included too? This would provide a nice way to subscribe to the user's global profile for changes from other devices which I don't think exists right now (and maybe it could be included, even if the user isn't part of any rooms). Either way, the MSC should presumably explicitly mention the expected behaviour here.

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 had a similar question while reviewing MSC4186. There, a leave for a given room is only sent down to the client if the room that was left was previously sent to the client in that connection.

Seems this MSC could specify a similar rule when choosing which rooms to include profile updates for.

}
```

If `enabled` is `true`, then the sliding sync response MAY include profile updates in the following format:

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've also been wondering how this extension would interact with the heroes portion of the sync response too. Would the idea be that the client keeps track of these global profiles and automatically merges the new fields (i.e. everything but avatar/name) with each room's heroes?

- Profile updates MUST be sent as the server receives them
- For rooms which initially appear (`initial: true`) due to direct subscriptions or rooms moving
into the sliding window, current profile states MUST be included
- A null value for a field indicates the field has been removed

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.

This conflicts with the profile endpoints of the CS API where setting a value to null doesn't remove the profile field, and might be an acceptable value since extended profiles were merged into the spec.

From the definition of PUT /profile/{userId}/{keyName}:

Servers MAY reject null values. Servers that accept null values SHOULD store them rather than treating null as a deletion request. Clients that want to delete a field, including its key and value, SHOULD use the DELETE endpoint instead.

@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 on lines +3 to +5
This MSC is an extension to [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575)
(and its proposed successor [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186))
which adds support for receiving profile updates via Sliding Sync. It complements

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 MSC should be updated to focus on extending MSC4186, now that it has been accepted.

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.


### Behaviour

1. The extension only returns profile updates for users who are members of rooms that the client is

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 had a similar question while reviewing MSC4186. There, a leave for a given room is only sent down to the client if the room that was left was previously sent to the client in that connection.

Seems this MSC could specify a similar rule when choosing which rooms to include profile updates for.

Comment on lines +55 to +58
3. The optional `include_history` argument controls whether the initial sync includes recent
historical profile changes:
- If false (default), only current profile states are sent on initial sync
- If true, the server MAY include recent profile changes that occurred before the 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.

Why would a client want previous profile data? Do homeservers even store historical profile state (Synapse doesn't)?

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.

I believe the objective was to show changes that occurred within the last minute or two before sync to understand whether a field has just updated, but a little time has passed so it's entirely possible I was on crack! 😄

- If true, the server MAY include recent profile changes that occurred before the sync

4. On an initial sync:
- Profile data MUST only be sent for rooms returned in the sliding sync 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.

Comment on lines +119 to +120
No unstable prefix as Sliding Sync is still in review. To enable this extension, add this to your
request JSON:

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.

Different now!

@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! 😊

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.

6 participants