Ensure clearing the cache delete the CacheStore.
This commit is contained in:
parent
93717d0db0
commit
ed58f7161e
8 changed files with 45 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import dev.zacsweers.metro.ContributesBinding
|
|||
import dev.zacsweers.metro.Provider
|
||||
import io.element.android.features.invite.api.SeenInvitesStore
|
||||
import io.element.android.features.preferences.impl.DefaultCacheService
|
||||
import io.element.android.libraries.cachestore.api.CacheStore
|
||||
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.libraries.di.SessionScope
|
||||
import io.element.android.libraries.di.annotations.ApplicationContext
|
||||
|
|
@ -37,8 +38,11 @@ class DefaultClearCacheUseCase(
|
|||
private val pushService: PushService,
|
||||
private val seenInvitesStore: SeenInvitesStore,
|
||||
private val activeRoomsHolder: ActiveRoomsHolder,
|
||||
private val cacheStore: CacheStore,
|
||||
) : ClearCacheUseCase {
|
||||
override suspend fun invoke() = withContext(coroutineDispatchers.io) {
|
||||
// Clear cache store
|
||||
cacheStore.deleteAll()
|
||||
// Active rooms should be disposed of before clearing the cache
|
||||
activeRoomsHolder.clear(matrixClient.sessionId)
|
||||
// Clear Matrix cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue