Invalidate crypto store cache when entering foreground #1854
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
depends on matrix-org/matrix-rust-sdk#3462
Partial fix for the NSE process causing olm session wedging.
See element-x related issue matrix-org/matrix-rust-sdk#3110.
The crypto store is keeping a cache of olm sessions for a given device. When using multiprocess this cache will get outdated and causing session wedging.
If the main app is inactive and the NSE do process a sync new olm sessions might be created (or mutated, like when replying to a key request). If the main process is then resumed it will use it's outdated cache instead of reloading from store.
The improvement here is that we will invalidate the cache when the main app enters foreground to limit the possible occurences of outdated caches.