Remove unused MatrixClient.availableSlidingSyncVersions().
This commit is contained in:
parent
0c436451b9
commit
a570b0d4ff
4 changed files with 1 additions and 23 deletions
|
|
@ -501,22 +501,16 @@ class LoggedInPresenterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - CheckSlidingSyncProxyAvailability forces the sliding sync migration under the right circumstances`() = runTest {
|
fun `present - CheckSlidingSyncProxyAvailability forces the sliding sync migration under the right circumstances`() = runTest {
|
||||||
// The migration will be forced if:
|
// The migration will be forced if the user is not using the native sliding sync
|
||||||
// - The user is not using the native sliding sync
|
|
||||||
// - The sliding sync proxy is no longer supported
|
|
||||||
// - The native sliding sync is supported
|
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
currentSlidingSyncVersionLambda = { Result.success(SlidingSyncVersion.Proxy) },
|
currentSlidingSyncVersionLambda = { Result.success(SlidingSyncVersion.Proxy) },
|
||||||
availableSlidingSyncVersionsLambda = { Result.success(listOf(SlidingSyncVersion.Native)) },
|
|
||||||
)
|
)
|
||||||
createLoggedInPresenter(
|
createLoggedInPresenter(
|
||||||
matrixClient = matrixClient,
|
matrixClient = matrixClient,
|
||||||
).test {
|
).test {
|
||||||
val initialState = awaitItem()
|
val initialState = awaitItem()
|
||||||
assertThat(initialState.forceNativeSlidingSyncMigration).isFalse()
|
assertThat(initialState.forceNativeSlidingSyncMigration).isFalse()
|
||||||
|
|
||||||
initialState.eventSink(LoggedInEvents.CheckSlidingSyncProxyAvailability)
|
initialState.eventSink(LoggedInEvents.CheckSlidingSyncProxyAvailability)
|
||||||
|
|
||||||
assertThat(awaitItem().forceNativeSlidingSyncMigration).isTrue()
|
assertThat(awaitItem().forceNativeSlidingSyncMigration).isTrue()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,11 +156,6 @@ interface MatrixClient {
|
||||||
*/
|
*/
|
||||||
suspend fun currentSlidingSyncVersion(): Result<SlidingSyncVersion>
|
suspend fun currentSlidingSyncVersion(): Result<SlidingSyncVersion>
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the available sliding sync versions for the current user.
|
|
||||||
*/
|
|
||||||
suspend fun availableSlidingSyncVersions(): Result<List<SlidingSyncVersion>>
|
|
||||||
|
|
||||||
fun canDeactivateAccount(): Boolean
|
fun canDeactivateAccount(): Boolean
|
||||||
suspend fun deactivateAccount(password: String, eraseData: Boolean): Result<Unit>
|
suspend fun deactivateAccount(password: String, eraseData: Boolean): Result<Unit>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -689,12 +689,6 @@ class RustMatrixClient(
|
||||||
})
|
})
|
||||||
}.buffer(Channel.UNLIMITED)
|
}.buffer(Channel.UNLIMITED)
|
||||||
|
|
||||||
override suspend fun availableSlidingSyncVersions(): Result<List<SlidingSyncVersion>> = withContext(sessionDispatcher) {
|
|
||||||
runCatchingExceptions {
|
|
||||||
innerClient.availableSlidingSyncVersions().map { it.map() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun currentSlidingSyncVersion(): Result<SlidingSyncVersion> = withContext(sessionDispatcher) {
|
override suspend fun currentSlidingSyncVersion(): Result<SlidingSyncVersion> = withContext(sessionDispatcher) {
|
||||||
runCatchingExceptions {
|
runCatchingExceptions {
|
||||||
innerClient.session().slidingSyncVersion.map()
|
innerClient.session().slidingSyncVersion.map()
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,6 @@ class FakeMatrixClient(
|
||||||
private val canDeactivateAccountResult: () -> Boolean = { lambdaError() },
|
private val canDeactivateAccountResult: () -> Boolean = { lambdaError() },
|
||||||
private val deactivateAccountResult: (String, Boolean) -> Result<Unit> = { _, _ -> lambdaError() },
|
private val deactivateAccountResult: (String, Boolean) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||||
private val currentSlidingSyncVersionLambda: () -> Result<SlidingSyncVersion> = { lambdaError() },
|
private val currentSlidingSyncVersionLambda: () -> Result<SlidingSyncVersion> = { lambdaError() },
|
||||||
private val availableSlidingSyncVersionsLambda: () -> Result<List<SlidingSyncVersion>> = { lambdaError() },
|
|
||||||
private val ignoreUserResult: (UserId) -> Result<Unit> = { lambdaError() },
|
private val ignoreUserResult: (UserId) -> Result<Unit> = { lambdaError() },
|
||||||
private var unIgnoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
|
private var unIgnoreUserResult: (UserId) -> Result<Unit> = { Result.success(Unit) },
|
||||||
private val canReportRoomLambda: () -> Boolean = { false },
|
private val canReportRoomLambda: () -> Boolean = { false },
|
||||||
|
|
@ -339,10 +338,6 @@ class FakeMatrixClient(
|
||||||
return currentSlidingSyncVersionLambda()
|
return currentSlidingSyncVersionLambda()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun availableSlidingSyncVersions(): Result<List<SlidingSyncVersion>> {
|
|
||||||
return availableSlidingSyncVersionsLambda()
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun canReportRoom(): Boolean {
|
override suspend fun canReportRoom(): Boolean {
|
||||||
return canReportRoomLambda()
|
return canReportRoomLambda()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue