Experimental support for MSC4429: Profile Updates for Legacy Sync#19556
Open
anoadragon453 wants to merge 11 commits intodevelopfrom
Open
Experimental support for MSC4429: Profile Updates for Legacy Sync#19556anoadragon453 wants to merge 11 commits intodevelopfrom
anoadragon453 wants to merge 11 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Implements experimental MSC4429 support by introducing a new profile_updates stream (persisted + replicated) and surfacing profile field changes in legacy /sync when enabled.
Changes:
- Add
profile_updatesstream tracking (DB schema, stream token field, notifier + replication stream plumbing). - Emit MSC4429 profile updates in
/syncresponses and add filter support for selecting profile fields. - Record profile field updates on profile mutations (set/unset displayname/avatar/custom fields, deactivation cleanup).
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rest/client/test_rooms.py | Updates hardcoded stream tokens to match the new StreamToken shape. |
| tests/rest/admin/test_room.py | Updates hardcoded stream tokens to match the new StreamToken shape. |
| synapse/types/init.py | Adds PROFILE_UPDATES stream key and extends StreamToken serialization/parsing. |
| synapse/streams/events.py | Includes profile_updates_key in current/bounded stream tokens. |
| synapse/storage/schema/main/delta/94/01_profile_updates_seq.sql.postgres | Adds Postgres sequence for the new stream. |
| synapse/storage/schema/main/delta/94/01_profile_updates.sql | Adds profile_updates table + indexes. |
| synapse/storage/schema/init.py | Bumps schema version to 94 and documents the change. |
| synapse/storage/databases/main/profile.py | Adds profile update persistence/query APIs and stream ID generator wiring. |
| synapse/rest/client/versions.py | Advertises org.matrix.msc4429 in unstable_features. |
| synapse/rest/client/sync.py | Encodes MSC4429 profile update payload into /sync response. |
| synapse/replication/tcp/streams/_base.py | Adds ProfileUpdatesStream replication stream. |
| synapse/replication/tcp/streams/init.py | Registers ProfileUpdatesStream for replication. |
| synapse/replication/tcp/handler.py | Replicates ProfileUpdatesStream from configured writers. |
| synapse/replication/tcp/client.py | Handles incoming profile update replication and notifies listeners. |
| synapse/notifier.py | Allows StreamKeyType.PROFILE_UPDATES to wake /sync waiters. |
| synapse/handlers/sync.py | Generates initial + incremental MSC4429 profile update sections in /sync. |
| synapse/handlers/profile.py | Records profile update markers on profile mutations and notifies. |
| synapse/config/experimental.py | Adds msc4429_enabled config flag. |
| synapse/api/filtering.py | Adds /sync filter support for selecting profile fields (MSC4429-gated). |
| docker/complement/conf/workers-shared-extra.yaml.j2 | Enables MSC4429 in complement worker test config. |
| changelog.d/19556.feature | Adds changelog entry for MSC4429 experimental support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
83e699f to
a846945
Compare
anoadragon453
added a commit
to matrix-org/sytest
that referenced
this pull request
Mar 17, 2026
anoadragon453
added a commit
to matrix-org/sytest
that referenced
this pull request
Mar 17, 2026
We create a stream table dedicated to tracking profile updates. The sync machinary can this stream to understand whether a profile update needs to be included in a client's sync response.
Add a new stream type for profile updates. This allows sync processes to determine which profile updates a given user has or hasn't seen yet.
Replicate changes to the profile updates stream so that sync workers know there's a new profile update, and wake up sync waiters accordingly. Updates are keyed by `room_id` - sync waiters should only wake up if a user they share a room with updates their profile.
Based on the provided since token and filter.
And update relevant documentation/integration test config.
Prevent the `ProfileRestServlet` from handling requests intended for the `ProfileFieldRestServlet`. If a requester tried to call PUT `.../profile/@user:domain/(key_id?)` a worker that did not mount `ProfileFieldRestServlet`, they would then receive a `405 Method Not Allowed` instead of the expected `404 Not Found`.
dc8e9f8 to
a309372
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements experimental support for MSC4429: Profile Updates for Legacy Sync.
Recommended to review commit-by-commit.
Paired with matrix-org/complement#849
Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.