mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-31 20:07:32 +01:00
Fix crash on signout: release session at the end so you clean up files first.
This commit is contained in:
parent
b30c27b7a6
commit
d8327a5161
1
changelog.d/3538.bugfix
Normal file
1
changelog.d/3538.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix crash on signout: release session at the end of clean up.
|
@ -51,15 +51,12 @@ internal class CleanupSession @Inject constructor(
|
|||||||
@UserMd5 private val userMd5: String
|
@UserMd5 private val userMd5: String
|
||||||
) {
|
) {
|
||||||
suspend fun handle() {
|
suspend fun handle() {
|
||||||
Timber.d("Cleanup: release session...")
|
Timber.d("Cleanup: delete session params...")
|
||||||
sessionManager.releaseSession(sessionId)
|
sessionParamsStore.delete(sessionId)
|
||||||
|
|
||||||
Timber.d("Cleanup: cancel pending works...")
|
Timber.d("Cleanup: cancel pending works...")
|
||||||
workManagerProvider.cancelAllWorks()
|
workManagerProvider.cancelAllWorks()
|
||||||
|
|
||||||
Timber.d("Cleanup: delete session params...")
|
|
||||||
sessionParamsStore.delete(sessionId)
|
|
||||||
|
|
||||||
Timber.d("Cleanup: clear session data...")
|
Timber.d("Cleanup: clear session data...")
|
||||||
clearSessionDataTask.execute(Unit)
|
clearSessionDataTask.execute(Unit)
|
||||||
|
|
||||||
@ -74,6 +71,9 @@ internal class CleanupSession @Inject constructor(
|
|||||||
realmKeysUtils.clear(SessionModule.getKeyAlias(userMd5))
|
realmKeysUtils.clear(SessionModule.getKeyAlias(userMd5))
|
||||||
realmKeysUtils.clear(CryptoModule.getKeyAlias(userMd5))
|
realmKeysUtils.clear(CryptoModule.getKeyAlias(userMd5))
|
||||||
|
|
||||||
|
Timber.d("Cleanup: release session...")
|
||||||
|
sessionManager.releaseSession(sessionId)
|
||||||
|
|
||||||
// Sanity check
|
// Sanity check
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Realm.getGlobalInstanceCount(realmSessionConfiguration)
|
Realm.getGlobalInstanceCount(realmSessionConfiguration)
|
||||||
|
Loading…
Reference in New Issue
Block a user