From 578a87e2c04cb016b89e53c4980235a5405b575a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 2 May 2024 10:01:14 +0100 Subject: [PATCH] Fix bug where push rules would be empty in `/sync` Fixes #16987 --- synapse/handlers/sync.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index 8ff45a3353b..0332fe66994 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -1945,23 +1945,19 @@ async def _generate_sync_entry_for_account_data( ) if push_rules_changed: - global_account_data = { - AccountDataTypes.PUSH_RULES: await self._push_rules_handler.push_rules_for_user( - sync_config.user - ), - **global_account_data, - } + global_account_data = dict(global_account_data) + global_account_data[AccountDataTypes.PUSH_RULES] = ( + await self._push_rules_handler.push_rules_for_user(sync_config.user) + ) else: all_global_account_data = await self.store.get_global_account_data_for_user( user_id ) - global_account_data = { - AccountDataTypes.PUSH_RULES: await self._push_rules_handler.push_rules_for_user( - sync_config.user - ), - **all_global_account_data, - } + global_account_data = dict(all_global_account_data) + global_account_data[AccountDataTypes.PUSH_RULES] = ( + await self._push_rules_handler.push_rules_for_user(sync_config.user) + ) account_data_for_user = ( await sync_config.filter_collection.filter_global_account_data(