Create AppMigration09 to remove the cached well-known config from the SDK (#6026)
This value was most likely was incorrectly cached due to a previous issue in the SDK
This commit is contained in:
parent
1070b55bb9
commit
a464e29570
5 changed files with 104 additions and 0 deletions
|
|
@ -214,7 +214,15 @@ interface MatrixClient {
|
|||
*/
|
||||
fun createLinkDesktopHandler(): Result<LinkDesktopHandler>
|
||||
|
||||
/**
|
||||
* Performs a database optimization that should flush cached data and improve performance.
|
||||
*/
|
||||
suspend fun performDatabaseVacuum(): Result<Unit>
|
||||
|
||||
/**
|
||||
* Resets the cached client `well-known` config by the SDK.
|
||||
*/
|
||||
suspend fun resetWellKnownConfig(): Result<Unit>
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -791,6 +791,13 @@ class RustMatrixClient(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun resetWellKnownConfig(): Result<Unit> {
|
||||
return runCatchingExceptions {
|
||||
Timber.d("Resetting well-known config for session $sessionId")
|
||||
innerClient.resetWellKnown()
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getCacheSize(
|
||||
includeCryptoDb: Boolean = false,
|
||||
): Long = withContext(sessionDispatcher) {
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ class FakeMatrixClient(
|
|||
private val markRoomAsFullyReadResult: (RoomId, EventId) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||
private val performDatabaseVacuumLambda: () -> Result<Unit> = { lambdaError() },
|
||||
private val getDatabaseSizesLambda: () -> Result<SdkStoreSizes> = { lambdaError() },
|
||||
private val resetWellKnownConfigLambda: () -> Result<Unit> = { lambdaError() },
|
||||
) : MatrixClient {
|
||||
var setDisplayNameCalled: Boolean = false
|
||||
private set
|
||||
|
|
@ -379,4 +380,8 @@ class FakeMatrixClient(
|
|||
override fun createLinkMobileHandler(): Result<LinkMobileHandler> {
|
||||
return createLinkMobileHandlerResult()
|
||||
}
|
||||
|
||||
override suspend fun resetWellKnownConfig(): Result<Unit> {
|
||||
return resetWellKnownConfigLambda()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue