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

Fix invalidating OTK count cache after claim #10875

Merged
merged 2 commits into from
Sep 22, 2021
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/10875.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix invalidating one-time key count cache after claiming keys. Contributed by Tulir at Beeper.
4 changes: 4 additions & 0 deletions synapse/storage/databases/main/end_to_end_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,10 @@ def _claim_e2e_one_time_key_returning(
if otk_row is None:
return None

self._invalidate_cache_and_stream(
txn, self.count_e2e_one_time_keys, (user_id, device_id)
)

key_id, key_json = otk_row
return f"{algorithm}:{key_id}", key_json

Expand Down