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

Commit b954079

Browse files
authored
Avoid mutating cached values in _generate_sync_entry_for_account_data (#15047)
1 parent a481fb9 commit b954079

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changelog.d/15047.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Avoid mutating cached values in `_generate_sync_entry_for_account_data`.

synapse/handlers/sync.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,6 +1753,7 @@ async def _generate_sync_entry_for_account_data(
17531753
)
17541754

17551755
if push_rules_changed:
1756+
global_account_data = dict(global_account_data)
17561757
global_account_data["m.push_rules"] = await self.push_rules_for_user(
17571758
sync_config.user
17581759
)
@@ -1763,6 +1764,7 @@ async def _generate_sync_entry_for_account_data(
17631764
account_data_by_room,
17641765
) = await self.store.get_account_data_for_user(sync_config.user.to_string())
17651766

1767+
global_account_data = dict(global_account_data)
17661768
global_account_data["m.push_rules"] = await self.push_rules_for_user(
17671769
sync_config.user
17681770
)

0 commit comments

Comments
 (0)