-
Notifications
You must be signed in to change notification settings - Fork 395
Description
When trying to obtain a CrossProcessLock on the CryptoStore, Encryption::try_lock_store_once uses OlmMachine to maintain a custom database value in the CryptoStore. However, this is not necessary, as CrossProcessLock already manages leased locks in the database.
Furthermore, Encryption::try_lock_store_once ignores the CrossProcessLockState and makes it's own determination of whether the lock is dirty. This should also be changed such that it relies on the dirtiness mechanism exposed by CrossProcessLock, and when dirty, the OlmMachine should simply be regenerated.
Note that this should also apply to EncryptionStore::spin_lock_store.
It may also be useful to encapsulate some of this behavior in a CryptoStoreLock akin to, e.g., EventCacheStoreLock.
This seems like it is likely related to #3313.