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: Tulir Asokan <tulir@beeper.com>pull/10883/head
parent
8f2a52766b
commit
03db6701d5
|
@ -0,0 +1 @@
|
||||||
|
Fix invalidating one-time key count cache after claiming keys. Contributed by Tulir at Beeper.
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue