-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFI Bindings: Expose CryptoStore clear caches #3462
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3462 +/- ##
=======================================
Coverage 83.29% 83.29%
=======================================
Files 248 248
Lines 25236 25237 +1
=======================================
+ Hits 21021 21022 +1
Misses 4215 4215 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit reluctant to approve this PR because abusing the clear_crypto_cache
can slow things down. It's kind of obvious though. Nonetheless, it is still safe to clear the crypto cache too often.
I'll approve it once the feedback is addressed.
Co-authored-by: Ivan Enderlin <[email protected]> Signed-off-by: Valere <[email protected]>
Yes more details here element-hq/element-ios#7790 |
/// When used in a multi-process context this cache will get outdated. | ||
/// If the machine is used by another process, the cache must be | ||
/// invalidating when the main process is resumed. | ||
pub async fn clear_crypto_cache(&self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this? It doesn't crash? Don't you need to modify the export line at the top of the impl
block to #[uniffi::export(async_runtime = "tokio")]
for it not to crash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I have tried, and no crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Exposes the crypto store
clear_caches
method on the OlmMachine to be used by EI to invalidate cache when multiprocess is involed. (see EXI equivalent #3338)Signed-off-by: