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

Optimize private read receipt filtering #12711

Merged
Prev Previous commit
Next Next commit
Copy events to not mutate cache
Signed-off-by: Šimon Brandner <[email protected]>
  • Loading branch information
SimonBrandner committed May 11, 2022
commit a5059b9896e9ec173c3a8dab92ee5ae59c64ee23
1 change: 1 addition & 0 deletions synapse/handlers/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def filter_out_private(events: List[JsonDict], our_user_id: str) -> List[JsonDic
current user.
"""

events = events.copy()
# filter out private receipts the user shouldn't see
for index, event in enumerate(events):
content = event.get("content", {})
Expand Down