Skip to content

Commit

Permalink
Fix bug where push rules would be empty in /sync
Browse files Browse the repository at this point in the history
Fixes #16987
  • Loading branch information
erikjohnston committed May 2, 2024
1 parent 7254015 commit 578a87e
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 578a87e

Please sign in to comment.