Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Avoid mutating cached values in _generate_sync_entry_for_account_data #15047

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15047.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid mutating cached values in `_generate_sync_entry_for_account_data`.
2 changes: 2 additions & 0 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@ async def _generate_sync_entry_for_account_data(
)

if push_rules_changed:
global_account_data = dict(global_account_data)
global_account_data["m.push_rules"] = await self.push_rules_for_user(
sync_config.user
)
Expand All @@ -1763,6 +1764,7 @@ async def _generate_sync_entry_for_account_data(
account_data_by_room,
) = await self.store.get_account_data_for_user(sync_config.user.to_string())

global_account_data = dict(global_account_data)
global_account_data["m.push_rules"] = await self.push_rules_for_user(
sync_config.user
)
Expand Down