Remove the protocol for SpaceServiceRoom given its a struct type. (#5000)

* Remove the protocol for SpaceServiceRoom given its a struct type.

* Fix a few missed mocks in the unit tests.
This commit is contained in:
Doug
2026-01-26 09:45:46 +00:00
committed by GitHub
parent 3b231339cd
commit 06f37dacae
46 changed files with 459 additions and 545 deletions
@@ -18,7 +18,7 @@ enum SpaceFlowCoordinatorAction {
enum SpaceFlowCoordinatorEntryPoint {
case space(SpaceRoomListProxyProtocol)
case joinSpace(SpaceServiceRoomProtocol)
case joinSpace(SpaceServiceRoom)
var spaceID: String {
switch self {
@@ -301,7 +301,7 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
guard event == .startCreateChildRoomFlow, case .space = fromState else { return nil }
return .createChildRoomFlow
} handler: { [weak self] context in
guard let space = context.userInfo as? SpaceServiceRoomProtocol else { fatalError("The space is missing") }
guard let space = context.userInfo as? SpaceServiceRoom else { fatalError("The space is missing") }
self?.startCreateChildFlow(space: space)
}
@@ -561,7 +561,7 @@ class SpaceFlowCoordinator: FlowCoordinatorProtocol {
flowCoordinator.start()
}
private func startCreateChildFlow(space: SpaceServiceRoomProtocol) {
private func startCreateChildFlow(space: SpaceServiceRoom) {
let stackCoordinator = NavigationStackCoordinator()
let flowCoordinator = StartChatFlowCoordinator(entryPoint: .createRoomInSpace(space),
userDiscoveryService: UserDiscoveryService(clientProxy: flowParameters.userSession.clientProxy),
@@ -25,7 +25,7 @@ enum StartChatFlowCoordinatorAction {
enum StartChatFlowCoordinatorEntryPoint {
case startChat
case createSpace
case createRoomInSpace(SpaceServiceRoomProtocol)
case createRoomInSpace(SpaceServiceRoom)
}
class StartChatFlowCoordinator: FlowCoordinatorProtocol {
@@ -141,7 +141,7 @@ class StartChatFlowCoordinator: FlowCoordinatorProtocol {
}
stateMachine.addRoutes(event: .createRoom(isSpace: false), transitions: [.initial => .createRoom]) { [weak self] context in
guard context.fromState == .initial else { return } // Required check because the event is used in another route.
guard let space = context.userInfo as? SpaceServiceRoomProtocol else {
guard let space = context.userInfo as? SpaceServiceRoom else {
fatalError("This transition only supports creating a room in a pre-selected space.")
}
self?.presentCreateRoomScreen(isSpace: false, spaceSelectionMode: .preSelected(space), isRoot: true)