Merge pull request #66 from vector-im/feature/bma/sonar

Sonar / Kover / Codecov
This commit is contained in:
Benoit Marty 2023-02-02 11:33:12 +01:00 committed by GitHub
commit a4f9354e8a
14 changed files with 156 additions and 16 deletions

View file

@ -87,7 +87,7 @@ internal class RustMatrixClient internal constructor(
.addView(slidingSyncView)
.build()
private val slidingSyncObserverProxy = SlidingSyncObserverProxy(coroutineScope, dispatchers)
private val slidingSyncObserverProxy = SlidingSyncObserverProxy(coroutineScope)
private val roomSummaryDataSource: RustRoomSummaryDataSource =
RustRoomSummaryDataSource(
slidingSyncObserverProxy.updateSummaryFlow,

View file

@ -16,7 +16,6 @@
package io.element.android.libraries.matrix.sync
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
@ -30,7 +29,6 @@ private const val BUFFER_SIZE = 64
class SlidingSyncObserverProxy(
private val coroutineScope: CoroutineScope,
private val coroutineDispatchers: CoroutineDispatchers
) : SlidingSyncObserver {
private val updateSummaryMutableFlow =
@ -39,7 +37,7 @@ class SlidingSyncObserverProxy(
override fun didReceiveSyncUpdate(summary: UpdateSummary) {
if (summary.rooms.isEmpty()) return
coroutineScope.launch(coroutineDispatchers.io) {
coroutineScope.launch {
updateSummaryMutableFlow.emit(summary)
}
}