Skip to content
Snippets Groups Projects
Unverified Commit 03db6701 authored by Tulir Asokan's avatar Tulir Asokan Committed by GitHub
Browse files

Fix invalidating OTK count cache after claim (#10875)


The invalidation was missing in `_claim_e2e_one_time_key_returning`,
which is used on SQLite 3.24+ and Postgres. This could break e2ee if
nothing else happened to invalidate the caches before the keys ran out.

Signed-off-by: default avatarTulir Asokan <tulir@beeper.com>
parent 8f2a5276
No related branches found
No related tags found
No related merge requests found
Fix invalidating one-time key count cache after claiming keys. Contributed by Tulir at Beeper.
...@@ -824,6 +824,10 @@ class EndToEndKeyWorkerStore(EndToEndKeyBackgroundStore): ...@@ -824,6 +824,10 @@ class EndToEndKeyWorkerStore(EndToEndKeyBackgroundStore):
if otk_row is None: if otk_row is None:
return 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 key_id, key_json = otk_row
return f"{algorithm}:{key_id}", key_json return f"{algorithm}:{key_id}", key_json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment