refactored the ClientProxy to:

- throw an error during the init
- to have its init directly instantiate the sync service and the providers

Update ElementX/Sources/Services/UserSession/UserSessionStore.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

renamed
This commit is contained in:
Mauro Romito
2025-03-06 12:16:28 +01:00
committed by Mauro
parent 4d01d2aa0b
commit 7373eabffb
10 changed files with 134 additions and 148 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ struct ClientProxyMockConfiguration {
var userIDServerName: String?
var userID: String = RoomMemberProxyMock.mockMe.userID
var deviceID: String?
var roomSummaryProvider: RoomSummaryProviderProtocol? = RoomSummaryProviderMock(.init())
var roomSummaryProvider: RoomSummaryProviderProtocol = RoomSummaryProviderMock(.init())
var roomDirectorySearchProxy: RoomDirectorySearchProxyProtocol?
var recoveryState: SecureBackupRecoveryState = .enabled
@@ -86,7 +86,7 @@ extension ClientProxyMock {
resetIdentityReturnValue = .success(IdentityResetHandleSDKMock(.init()))
roomForIdentifierClosure = { [weak self] identifier in
guard let room = self?.roomSummaryProvider?.roomListPublisher.value.first(where: { $0.id == identifier }) else {
guard let room = self?.roomSummaryProvider.roomListPublisher.value.first(where: { $0.id == identifier }) else {
return nil
}
@@ -2267,9 +2267,21 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
}
var underlyingIgnoredUsersPublisher: CurrentValuePublisher<[String]?, Never>!
var pusherNotificationClientIdentifier: String?
var roomSummaryProvider: RoomSummaryProviderProtocol?
var alternateRoomSummaryProvider: RoomSummaryProviderProtocol?
var staticRoomSummaryProvider: StaticRoomSummaryProviderProtocol?
var roomSummaryProvider: RoomSummaryProviderProtocol {
get { return underlyingRoomSummaryProvider }
set(value) { underlyingRoomSummaryProvider = value }
}
var underlyingRoomSummaryProvider: RoomSummaryProviderProtocol!
var alternateRoomSummaryProvider: RoomSummaryProviderProtocol {
get { return underlyingAlternateRoomSummaryProvider }
set(value) { underlyingAlternateRoomSummaryProvider = value }
}
var underlyingAlternateRoomSummaryProvider: RoomSummaryProviderProtocol!
var staticRoomSummaryProvider: StaticRoomSummaryProviderProtocol {
get { return underlyingStaticRoomSummaryProvider }
set(value) { underlyingStaticRoomSummaryProvider = value }
}
var underlyingStaticRoomSummaryProvider: StaticRoomSummaryProviderProtocol!
var roomsToAwait: Set<String> {
get { return underlyingRoomsToAwait }
set(value) { underlyingRoomsToAwait = value }