diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-02-10 09:22:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-10 14:22:16 +0000 |
commit | cf5233b783273efc84b991e7242fb4761ccc201a (patch) | |
tree | a7f940361308ce730a6d9064803fbb5bee890bd1 /synapse/handlers/account_data.py | |
parent | Merge branch 'release-v1.77' into develop (diff) | |
download | synapse-cf5233b783273efc84b991e7242fb4761ccc201a.tar.xz |
Avoid fetching unused account data in sync. (#14973)
The per-room account data is no longer unconditionally fetched, even if all rooms will be filtered out. Global account data will not be fetched if it will all be filtered out.
Diffstat (limited to 'synapse/handlers/account_data.py')
-rw-r--r-- | synapse/handlers/account_data.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/handlers/account_data.py b/synapse/handlers/account_data.py index 67e789eef7..797de46dbc 100644 --- a/synapse/handlers/account_data.py +++ b/synapse/handlers/account_data.py @@ -343,10 +343,12 @@ class AccountDataEventSource(EventSource[int, JsonDict]): } ) - ( - account_data, - room_account_data, - ) = await self.store.get_updated_account_data_for_user(user_id, last_stream_id) + account_data = await self.store.get_updated_global_account_data_for_user( + user_id, last_stream_id + ) + room_account_data = await self.store.get_updated_room_account_data_for_user( + user_id, last_stream_id + ) for account_data_type, content in account_data.items(): results.append({"type": account_data_type, "content": content}) |