Skip to content
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

Fix crash on signout: release session at the end of clean up #3538

Merged
merged 1 commit into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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