Avoid mutating cached values in `_generate_sync_entry_for_account_data` (#15047)

pull/15070/head
Sean Quah 2023-02-10 13:11:20 +00:00 committed by GitHub
parent a481fb9f98
commit b95407908d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

1
changelog.d/15047.misc Normal file
View File

@ -0,0 +1 @@
Avoid mutating cached values in `_generate_sync_entry_for_account_data`.

View File

@ -1753,6 +1753,7 @@ class SyncHandler:
)
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
)
@ -1763,6 +1764,7 @@ class SyncHandler:
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
)