File tree 3 files changed +22
-0
lines changed
bindings/matrix-sdk-crypto-ffi/src
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1534,6 +1534,17 @@ impl OlmMachine {
1534
1534
}
1535
1535
. into ( )
1536
1536
}
1537
+
1538
+ /// Clear any in-memory caches because they may be out of sync with the
1539
+ /// underlying data store.
1540
+ ///
1541
+ /// The crypto store layer is caching olm sessions for a given device.
1542
+ /// When used in a multi-process context this cache will get outdated.
1543
+ /// If the machine is used by another process, the cache must be
1544
+ /// invalidating when the main process is resumed.
1545
+ pub async fn clear_crypto_cache ( & self ) {
1546
+ self . inner . clear_crypto_cache ( ) . await
1547
+ }
1537
1548
}
1538
1549
1539
1550
impl OlmMachine {
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ Deprecations:
50
50
51
51
Additions:
52
52
53
+
54
+ - Expose new method ` OlmMachine::clear_crypto_cache() ` , with FFI bindings
55
+ ([ #3462 ] ( https://github.com/matrix-org/matrix-rust-sdk/pull/3462 ) )
56
+
53
57
- Expose new method ` OlmMachine::upload_device_keys() ` .
54
58
([ #3457 ] ( https://github.com/matrix-org/matrix-rust-sdk/pull/3457 ) )
55
59
Original file line number Diff line number Diff line change @@ -2150,6 +2150,13 @@ impl OlmMachine {
2150
2150
let account = cache. account ( ) . await ?;
2151
2151
Ok ( account. uploaded_key_count ( ) )
2152
2152
}
2153
+
2154
+ /// Clear any in-memory caches because they may be out of sync with the
2155
+ /// underlying data store.
2156
+ pub async fn clear_crypto_cache ( & self ) {
2157
+ let crypto_store = self . store ( ) . crypto_store ( ) ;
2158
+ crypto_store. as_ref ( ) . clear_caches ( ) . await ;
2159
+ }
2153
2160
}
2154
2161
2155
2162
/// A set of requests to be executed when bootstrapping cross-signing using
You can’t perform that action at this time.
0 commit comments