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

Commit

Permalink
Avoid mutating cached values in `_generate_sync_entry_for_account_dat…
Browse files Browse the repository at this point in the history
…a` (#15047)
  • Loading branch information
squahtx authored Feb 10, 2023
1 parent a481fb9 commit b954079
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
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

0 comments on commit b954079

Please sign in to comment.