Skip to content

Commit

Permalink
Merge pull request #3538 from vector-im/feature/fga/fix_signout
Browse files Browse the repository at this point in the history
Fix crash on signout: release session at the end of clean up
  • Loading branch information
bmarty authored Jun 21, 2021
2 parents b30c27b + d8327a5 commit 4340180
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/3538.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix crash on signout: release session at the end of clean up.
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,12 @@ internal class CleanupSession @Inject constructor(
@UserMd5 private val userMd5: String
) {
suspend fun handle() {
Timber.d("Cleanup: release session...")
sessionManager.releaseSession(sessionId)
Timber.d("Cleanup: delete session params...")
sessionParamsStore.delete(sessionId)

Timber.d("Cleanup: cancel pending works...")
workManagerProvider.cancelAllWorks()

Timber.d("Cleanup: delete session params...")
sessionParamsStore.delete(sessionId)

Timber.d("Cleanup: clear session data...")
clearSessionDataTask.execute(Unit)

Expand All @@ -74,6 +71,9 @@ internal class CleanupSession @Inject constructor(
realmKeysUtils.clear(SessionModule.getKeyAlias(userMd5))
realmKeysUtils.clear(CryptoModule.getKeyAlias(userMd5))

Timber.d("Cleanup: release session...")
sessionManager.releaseSession(sessionId)

// Sanity check
if (BuildConfig.DEBUG) {
Realm.getGlobalInstanceCount(realmSessionConfiguration)
Expand Down

0 comments on commit 4340180

Please sign in to comment.