Add banner for optional migration to simplified sliding sync (#3429)

* Add banner for optional migration to native sliding sync

- Add `MatrixClient.isNativeSlidingSyncSupported()` and `MatrixClient.isUsingNativeSlidingSync` to check whether the home server supports native sliding sync and we're already using it.
- Add `NativeSlidingSyncMigrationBanner` composable to the `RoomList` screen when the home server supports native sliding sync but the current session is not using it.
- Add an extra logout successful action to the logout flow, create `EnableNativeSlidingSyncUseCase` so it can be used there.

* Update screenshots

* Make sure the sliding sync migration banner has lower priority than the encryption setup ones

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2024-09-09 18:13:19 +02:00 committed by GitHub
parent 7549d5f475
commit 67e262fdc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 283 additions and 12 deletions

View file

@ -77,6 +77,8 @@ class FakeMatrixClient(
private val clearCacheLambda: () -> Unit = { lambdaError() },
private val userIdServerNameLambda: () -> String = { lambdaError() },
private val getUrlLambda: (String) -> Result<String> = { lambdaError() },
var isNativeSlidingSyncSupportedLambda: suspend () -> Boolean = { true },
var isUsingNativeSlidingSyncLambda: () -> Boolean = { true },
) : MatrixClient {
var setDisplayNameCalled: Boolean = false
private set
@ -316,4 +318,12 @@ class FakeMatrixClient(
override suspend fun getUrl(url: String): Result<String> {
return getUrlLambda(url)
}
override suspend fun isNativeSlidingSyncSupported(): Boolean {
return isNativeSlidingSyncSupportedLambda()
}
override fun isUsingNativeSlidingSync(): Boolean {
return isUsingNativeSlidingSyncLambda()
}
}