Switch the ClientProxy's roomForIdentifier state publisher await to the staticRoomSummaryProvider, similar to the other methods.

This commit is contained in:
Stefan Ceriu
2025-11-17 12:08:58 +02:00
committed by Stefan Ceriu
parent 0dd18929bd
commit 0d581cdf86
3 changed files with 10 additions and 5 deletions
@@ -16383,6 +16383,11 @@ class SpaceServiceProxyMock: SpaceServiceProxyProtocol, @unchecked Sendable {
} }
} }
class StaticRoomSummaryProviderMock: StaticRoomSummaryProviderProtocol, @unchecked Sendable { class StaticRoomSummaryProviderMock: StaticRoomSummaryProviderProtocol, @unchecked Sendable {
var statePublisher: CurrentValuePublisher<RoomSummaryProviderState, Never> {
get { return underlyingStatePublisher }
set(value) { underlyingStatePublisher = value }
}
var underlyingStatePublisher: CurrentValuePublisher<RoomSummaryProviderState, Never>!
var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> {
get { return underlyingRoomListPublisher } get { return underlyingRoomListPublisher }
set(value) { underlyingRoomListPublisher = value } set(value) { underlyingRoomListPublisher = value }
@@ -591,8 +591,8 @@ class ClientProxy: ClientProxyProtocol {
return room return room
} }
if !roomSummaryProvider.statePublisher.value.isLoaded { if !staticRoomSummaryProvider.statePublisher.value.isLoaded {
_ = await roomSummaryProvider.statePublisher.values.first { $0.isLoaded } _ = await staticRoomSummaryProvider.statePublisher.values.first { $0.isLoaded }
} }
if shouldAwait { if shouldAwait {
@@ -44,6 +44,9 @@ enum RoomSummaryProviderFilter: Equatable {
// sourcery: AutoMockable // sourcery: AutoMockable
protocol StaticRoomSummaryProviderProtocol { protocol StaticRoomSummaryProviderProtocol {
/// Publishes the current state the summary provider is finding itself in
var statePublisher: CurrentValuePublisher<RoomSummaryProviderState, Never> { get }
/// Publishes the currently available room summaries /// Publishes the currently available room summaries
var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { get } var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { get }
@@ -52,9 +55,6 @@ protocol StaticRoomSummaryProviderProtocol {
// sourcery: AutoMockable // sourcery: AutoMockable
protocol RoomSummaryProviderProtocol: StaticRoomSummaryProviderProtocol { protocol RoomSummaryProviderProtocol: StaticRoomSummaryProviderProtocol {
/// Publishes the current state the summary provider is finding itself in
var statePublisher: CurrentValuePublisher<RoomSummaryProviderState, Never> { get }
func updateVisibleRange(_ range: Range<Int>) func updateVisibleRange(_ range: Range<Int>)
func setFilter(_ filter: RoomSummaryProviderFilter) func setFilter(_ filter: RoomSummaryProviderFilter)