-
Notifications
You must be signed in to change notification settings - Fork 564
Introduce support for MSC4429: Profile Updates for Legacy Sync #19556
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
anoadragon453
wants to merge
141
commits into
develop
Choose a base branch
from
anoa/msc4429
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,434
−279
Open
Changes from all commits
Commits
Show all changes
141 commits
Select commit
Hold shift + click to select a range
632c83e
Add experimental feature flag `msc4429_enabled`
anoadragon453 d0b616d
Schema for new profile updates stream table
anoadragon453 63cfbe7
Add profile updates stream
anoadragon453 e45045d
Implement replication
anoadragon453 d9adfd8
Allow fetching latest changes via /sync and filtering
anoadragon453 30e8737
Add `msc4429_enabled` to Complement tests
anoadragon453 cfb7034
newsfile
anoadragon453 5b4d505
Update unit tests with new token format
anoadragon453 86572c6
Constrain profile endpoint handling to `profile_updates` writer workers
anoadragon453 3221271
Prevent 405 Method Not Allowed
anoadragon453 f27ca70
Correct the Complement worker endpoint configuration
anoadragon453 e37a200
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
Half-Shot f95d28a
Bump schema for profile updates
Half-Shot 8accba6
Merge branch 'develop' of github.com:element-hq/synapse into anoa/msc…
anoadragon453 343d4df
Drop `profile_updates_fk_users` foreign key
jaywink 386958c
Add a timestamp column to `profile_updates`
jaywink c02e6a6
Only pass field names to `add_profile_updates`
jaywink 4e820ca
Multiline string for `_get_updated_profile_updates_txn`
jaywink 7e964a9
`user_id: UserID` in `ProfileUpdatesStreamRow`
jaywink fcbceee
Don't return anything for users without profiles in `_generate_initia…
jaywink 2fa20e0
Only support unstable prefix for `profile_fields` in API filters
jaywink 6ec8ee2
Mount ProfileFieldRestServlet on all Synapse instances
jaywink df1b587
Add `ReplicationProfileSetFieldValue` endpoint
jaywink e4c35ce
Add missing value to docstring
jaywink c30e0d9
Also replicate DELETE profile fields to the right stream worker
jaywink 352efe1
Fix replication of profile updates to the right stream writer
jaywink 56a3647
Remove unnecessary upgrade notes for profile updates stream writer
jaywink 632c7ea
Add a docstring, remove premature optimization
jaywink 92bfed7
Don't return null's in initial sync for profiles with no value for th…
jaywink 4697e73
Simplify collecting profile field updates for sync
jaywink 3444aef
Improve docstrings of `get_updated_profile_updates` and `get_profile_…
jaywink 4c2bbbc
Use a "many" insert for `add_profile_updates`
jaywink 4cf5e09
Clarify `_generate_initial_sync_entry_for_profile_updates` is for loc…
jaywink c082da4
Allow a `msc4429_enabled` config alias outside of the experimental co…
jaywink aeeb933
Restrict initial sync profiles to local users for now
jaywink 54c299d
Clarify newsfile that this pr is for local users only
jaywink 3cf7555
Clarify profile updates sync response with a comment
jaywink d254167
Clarify in `_generate_sync_entry_for_profile_updates` that only local…
jaywink 391fd2b
Merge branch 'develop' into anoa/msc4429
jaywink e236ddb
Add SyncProfileUpdatesTestCase
jaywink 1ae91c8
Fix `get_profile_data_for_users` if user does not have custom fields
jaywink 1a59c0a
Only return profiles for initial sync that have events when using laz…
jaywink bd40add
Add some tests for profile handler updating profile_updates stream ta…
jaywink b61f748
Fix some broken tests due to sync token changes
jaywink 36f0f64
Add "action" to profile updates stream
jaywink 301e9c1
ProfileUpdate.action should never be None
jaywink 2d9f943
Collect lazy loaded members for profile updates in sync response from…
jaywink e6c25e4
Add `profile_updates_sequence` sequence to synapse_port_db.py
jaywink 28587d7
Fix the lazy loading test cases
jaywink d02150f
Remove code that accidentally came here from https://github.com/eleme…
jaywink 877074f
Lint tests/handlers/test_sync.py
jaywink e90096e
Use a "per user profile updates" tracking table
jaywink 21d08a0
Optimize calculating left room id's for incremental sync
jaywink 029c4d8
Create `profile_updates_per_user`
anoadragon453 676ef4f
Read from `profile_updates_per_user` when syncing
anoadragon453 4a3fc09
fix the tests
anoadragon453 ab9c917
Remove `test_incremental_sync_sends_down_null_profile_if_user_no_long…
anoadragon453 874dc35
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink 27417cf
Remove mypy ignore
jaywink daa8d7a
Ensure lazy loaded profile updates in sync contain full profiles for …
jaywink 5819dcc
Use a cache to ensure we don't re-send the full profile fields of use…
jaywink 09e2125
Fix incremental lazy sync to send down profiles for users without pro…
jaywink 339eee5
WIP track when a user leaves a room in `profile_updates_per_user`
anoadragon453 2dbaec3
Send down a null when user has left all shared rooms
jaywink 8504386
Send down full profile of user if user has joined during incremental …
jaywink 50e788b
Add foreign key to `profile_updates_per_user.stream_id`
jaywink ddb0c52
Actually run MSC4429 complement tests in CI
anoadragon453 9d58d19
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink d3aacee
Fix `test_update_profile_set_field_writes_to_per_user_profile_trackin…
jaywink 7c728ec
Optimize profile handler `user_joined_room` and `user_left_room`
jaywink 05634f9
Ensure `room_member` handler writes profile updates to the right prof…
jaywink b657d2f
Add a prune job for the profile updates stream tables
jaywink ea12b22
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink 3e4301a
Remove unnecessary if
jaywink 5f761ab
Use set for uniqueness
jaywink bf10187
Docstring for ProfileUpdateAction
jaywink 585590b
Protect against stream being rewound
jaywink e278dfd
Restore initial sync behaviour to return full profiles of users curre…
jaywink 8bace9f
Fix some types in various places regarding profile field values
jaywink 7a60657
Clean up recording profile updates on changes
jaywink f453e03
Remove more useless casts
jaywink b2246de
Ensure we don't call `_dispatch_record_profile_updates` with an empty…
jaywink b459512
Use `include_profile_updates_in_sync` config item instead of an exper…
jaywink 4a874c4
Remove invalid docs on `profile_updates` stream
jaywink 088f230
Gate more things behind msc4429 being enabled
jaywink c12623e
Lint server config
jaywink 1fc8d4c
Move profile updates SQL to latest delta
jaywink b0950f9
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink bf3e133
Fix `SCHEMA_VERSION` in __init__.py
jaywink 60ed175
When user has left all rooms shared with a user, clear any previous p…
jaywink 2377165
Add test to prove initial sync doesn't include users updates who don'…
jaywink 496728d
Add docstrings to tests
jaywink 5064349
Don't delete custom profile field when setting an empty string
jaywink a460c28
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink eb5aa21
Ensure both initial and incremental syncs include our own profile and…
jaywink e6aec55
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink ecd890a
Fix MSC4429 referring comment
jaywink 6a5adb9
Remove extra `ids` definition
jaywink 45e9a01
Don't unpact `ProfileUpdateAction` unnecessarily early
jaywink 6730ad0
Add `str` to ProfileUpdateAction types
jaywink 28563f0
Make `ProfileUpdateAction` docstrings more descriptive on what the di…
jaywink f6c1db7
Fix `StreamKeyType.__str__`
jaywink 180c6a2
tuples in `_track_profile_updates_per_user_txn`
jaywink e74046a
Remove confusing wording
jaywink 4271ffa
Add primary key to `profile_updates_per_user`
jaywink 4934fca
Clean up some SQL for easier reading
jaywink c7f3b79
Use `deleted_stream_id` instead of indexing on `row`
jaywink e68560a
Don't dump to json string in tests
jaywink 8685137
Correctly type `ProfileUpdatesStreamRow.action`
jaywink 56b7de2
Correctly type `ProfileUpdatesStreamRow.field_name`
jaywink 182e4c2
Clarify variable names and add comments to `ReplicationDataHandler`
jaywink 2c7b418
Ensure we filter out federated users in lazy loading sync when collec…
jaywink 6f6e633
Ensure we don't respond with profile fields the client didn't ask for
jaywink d3dd12f
Rewrite `lazy_loaded_profile_fields_cache`
jaywink 1955fbe
Ensure falsey values survive the set_field / sync profile updates -cycle
jaywink 425aa00
Add a join → leave → re-join → leave to try and rule out bugs in that…
jaywink b571fce
Clear all old ProfileUpdate rows from `profile_updates_per_user` on a…
jaywink f431951
Add a test to ensure display name changes don't generate extra room_j…
jaywink ac1bdfb
Clarify `clear_profile_updates_for_user` docstring
jaywink 73986ef
Add docstring to `get_lazy_loaded_profile_fields_cache`
jaywink 10cccac
Ensure we bust the lazy loading cache for profile updates, when field…
jaywink 15466d2
Use sha256 instead of md5
jaywink 2bea8c0
Revert "Add a prune job for the profile updates stream tables"
jaywink aa0dbdc
Update `check_schema_delta.py` to better parse raw SQL schema deltas
anoadragon453 f7d0555
Refactor profile updates behind the profile updates stream writer
jaywink 1937e76
Make `delete_profile_upon_deactivation` first delete the profile fiel…
jaywink 9052265
Remove a few unused methods and fix docstrings
jaywink d0aa8d0
Revert "Make `delete_profile_upon_deactivation` first delete the prof…
jaywink d7e0d35
Add some notes on missing tests for future readers
jaywink 7398242
Refactor user left room / user joined room profile updates
jaywink ae4e686
Ensure `delete_profile_upon_deactivation` does profile deletion and p…
jaywink ef9d995
Dispatch deletion of profile upon deactivation over replication to th…
jaywink cb81bd3
Merge remote-tracking branch 'origin/develop' into anoa/msc4429
jaywink 3180924
Update Rust side versions endpoint
jaywink 2ed4201
Adjust a few new tests after merging from develop
jaywink cb322e4
Ensure our own syncing user always gets their updates, even if they'r…
jaywink e9b8fd7
Fix deactivation from a worker that is not profile writer
jaywink 3ed759a
Add `include_profile_updates_in_sync` to the config schema
jaywink 50527b1
Hopefully final fix to deactivate over replication
jaywink fcac746
Rename profile updates db deltas as we got new stuff from develop
jaywink 8e75e7b
Always enable profile replication endpoints
jaywink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Add optional support for [MSC4429: Profile Updates for Legacy Sync](https://github.com/matrix-org/matrix-spec-proposals/pull/4429). | ||
| Currently defaults to not enabled, and is limited to local users only for the sync results. |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.