mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-22 15:50:51 +01:00
Cleanup and fix test compilation
This commit is contained in:
parent
4709002429
commit
c75eb050df
@ -378,7 +378,9 @@ class CommonTestHelper(context: Context) {
|
||||
fun Iterable<Session>.signOutAndClose() = forEach { signOutAndClose(it) }
|
||||
|
||||
fun signOutAndClose(session: Session) {
|
||||
doSync<Unit>(60_000) { session.signOut(true, it) }
|
||||
runBlockingTest(timeout = 60_000) {
|
||||
session.signOut(true)
|
||||
}
|
||||
// no need signout will close
|
||||
// session.close()
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ class TimelineForwardPaginationTest : InstrumentedTest {
|
||||
numberOfMessagesToSend)
|
||||
|
||||
// Alice clear the cache
|
||||
commonTestHelper.doSync<Unit> {
|
||||
aliceSession.clearCache(it)
|
||||
commonTestHelper.runBlockingTest {
|
||||
aliceSession.clearCache()
|
||||
}
|
||||
|
||||
// And restarts the sync
|
||||
|
@ -20,7 +20,6 @@ import androidx.annotation.MainThread
|
||||
import dagger.Lazy
|
||||
import io.realm.RealmConfiguration
|
||||
import okhttp3.OkHttpClient
|
||||
import org.matrix.android.sdk.api.MatrixCallback
|
||||
import org.matrix.android.sdk.api.auth.data.SessionParams
|
||||
import org.matrix.android.sdk.api.failure.GlobalError
|
||||
import org.matrix.android.sdk.api.pushrules.PushRuleService
|
||||
|
@ -175,12 +175,10 @@ class MainActivity : VectorBaseActivity<FragmentLoadingBinding>(), UnlockedActiv
|
||||
emptyViewModel.viewModelScope.launch {
|
||||
try {
|
||||
session.clearCache()
|
||||
Timber.e("CACHE success")
|
||||
doLocalCleanup(clearPreferences = false)
|
||||
session.startSyncing(applicationContext)
|
||||
startNextActivityAndFinish()
|
||||
} catch (failure: Throwable) {
|
||||
Timber.e("CACHE failure")
|
||||
displayError(failure)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user