rust sdk : handle api breaks for 0.2.59

This commit is contained in:
ganfra 2024-11-06 15:31:22 +01:00
parent 0bff08237d
commit f8d4b11f56
12 changed files with 55 additions and 24 deletions

View file

@ -28,6 +28,8 @@ import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import javax.inject.Inject
private const val SEARCH_BATCH_SIZE = 20
class RoomDirectoryPresenter @Inject constructor(
private val dispatchers: CoroutineDispatchers,
private val roomDirectoryService: RoomDirectoryService,
@ -51,7 +53,7 @@ class RoomDirectoryPresenter @Inject constructor(
loadingMore = false
// debounce search query
delay(300)
roomDirectoryList.filter(searchQuery, 20)
roomDirectoryList.filter(filter = searchQuery, batchSize = SEARCH_BATCH_SIZE, viaServerName = null)
}
LaunchedEffect(loadingMore) {
if (loadingMore) {

View file

@ -81,7 +81,7 @@ import org.junit.Test
@Test
fun `present - emit search event`() = runTest {
val filterLambda = lambdaRecorder { _: String?, _: Int ->
val filterLambda = lambdaRecorder { _: String?, _: Int, _: String? ->
Result.success(Unit)
}
val roomDirectoryList = FakeRoomDirectoryList(filterLambda = filterLambda)
@ -99,7 +99,7 @@ import org.junit.Test
}
assert(filterLambda)
.isCalledOnce()
.with(value("test"), any())
.with(value("test"), any(), value(null))
}
@Test