element-hq / element-hq/element-android
[Matrix-SDK] Proper Session CoroutineScope management
Open
matrix-sdk
T-Task
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description
At the moment we have a CoroutineScope defined in CryptoModule which is injected in some classes outside of crypto, this is not really clean.
https://github.com/vector-im/element-android/blob/2b629f130fc5b96a6f382442049680d5cbd72bc4/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/CryptoModule.kt#L132-L137
We should instead define this CoroutineScope in SessionModule and let it be managed in DefaultSession.
If need more scopes we should create them accordingly and inherits context from this root CoroutineScope (as we want them to be closed when session is closed).
Contributor guide
Assessment
This issue has not been assessed yet.