From 18978f02e518f4642ef6da0f8660ac63c7997f2b Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Fri, 10 Jul 2026 14:57:37 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- docs/usage/configuration/config_documentation.md | 2 +- synapse/config/server.py | 2 +- synapse/handlers/profile.py | 4 ++-- synapse/handlers/sync.py | 2 +- synapse/types/__init__.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index f1e5595bf5..675c3aceab 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -320,7 +320,7 @@ include_profile_data_on_invite: false --- ### `include_profile_updates_in_sync` -*(boolean)* Use this option to include updates of other users profiles in sync responses, for users who share rooms. +*(boolean)* Use this option to include updates of other users' profiles in sync responses, for users who share rooms. Note, requires an MSC4429 compatible client, and is currently limited to legacy sync and local users only. Defaults to `false`. Example configuration: diff --git a/synapse/config/server.py b/synapse/config/server.py index ffd4ef5ab8..8a4f24ffb9 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -545,7 +545,7 @@ class ServerConfig(Config): " 'allow_public_rooms_over_federation' is set." ) - # Whether to support MSC4299 profile updates down legacy /sync + # Whether to support MSC4429 profile updates down legacy /sync self.include_profile_updates_in_sync = config.get( "include_profile_updates_in_sync", False, diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index e55ace6f1b..d44ed482db 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -505,7 +505,7 @@ class ProfileHandler: self._notifier.on_new_event( StreamKeyType.PROFILE_UPDATES, stream_id, - rooms=set(room_id), + rooms={room_id}, ) async def user_joined_room(self, user_id: UserID, room_id: str) -> None: @@ -542,7 +542,7 @@ class ProfileHandler: self._notifier.on_new_event( StreamKeyType.PROFILE_UPDATES, stream_id, - rooms=set(room_id), + rooms={room_id}, ) async def dispatch_delete_profile_upon_deactivation( diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 2706a81709..9a8b1d5192 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -2402,7 +2402,7 @@ class SyncHandler: ) cache = self.get_lazy_loaded_profile_fields_cache(cache_key) # Only send this users field if we haven't recently sent it. - # Our cache value to check against is an md5 of a string of + # Our cache value to check against is a sha256 of a string of # user ID + field name + value, which ensures if the value # changes, we'll miss the cache, thus sending the field update # to the syncing user. diff --git a/synapse/types/__init__.py b/synapse/types/__init__.py index ef99d57554..bcbd11b45f 100644 --- a/synapse/types/__init__.py +++ b/synapse/types/__init__.py @@ -1393,7 +1393,7 @@ class StreamToken: f"to_device: {self.to_device_key}, device_list: {self.device_list_key}, " f"groups: {self.groups_key}, un_partial_stated_rooms: {self.un_partial_stated_rooms_key}, " f"thread_subscriptions: {self.thread_subscriptions_key}, sticky_events: {self.sticky_events_key}, " - f"quarantined_media: {self.quarantined_media_key}), " + f"quarantined_media: {self.quarantined_media_key}, " f"profile_updates: {self.profile_updates_key})" )