diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 86e48a4f94..dc786f05da 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -2142,10 +2142,7 @@ class SyncHandler: Build an initial sync entry for profile updates and attach it to the given `sync_result_builder`. - Note: Only the profile information for local users is returned. This is - to prevent fetching *too* many profiles in one request. Clients should - ideally instead first fetch profiles on-demand, then track updates for - all users via incremental `/sync`. + Note: Currently, only profile updates of local users are generated. Args: user_id: The Matrix ID of the user to generate the sync entry for. diff --git a/synapse/storage/databases/main/profile.py b/synapse/storage/databases/main/profile.py index 4e9c2e4f01..e70443fa77 100644 --- a/synapse/storage/databases/main/profile.py +++ b/synapse/storage/databases/main/profile.py @@ -431,7 +431,17 @@ class ProfileWorkerStore(SQLBaseStore): async def get_profile_data_for_users( self, user_ids: Collection[str] ) -> dict[str, dict[str, str | JsonDict | None]]: - """Fetch displayname/avatar_url/custom fields for a list of users.""" + """Fetch displayname/avatar_url/custom fields for a list of users. + + Currently, this returns only local users as the `profiles` table only + tracks local users. + + Args: + user_ids: List of user IDs to filter against. + + Returns: + Dictionary of displayname/avatar_url/custom fields for a list of users. + """ if not user_ids: return {}