Clarify _generate_initial_sync_entry_for_profile_updates is for local users only currently

This commit is contained in:
Jason Robinson
2026-06-01 12:22:51 +03:00
parent 4c2bbbce20
commit 4cf5e098a5
2 changed files with 12 additions and 5 deletions
+1 -4
View File
@@ -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.
+11 -1
View File
@@ -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 {}