Notification deep linking fix (#972)
* Fixed unused animated parameter * Wait for lists to load before querying rooms if the cold cache isn't available * Fix a couple of unused result warnings in the ExpiringTaskRunner unit tests
This commit is contained in:
parent
c5c066b7b2
commit
590655197d
|
@ -94,7 +94,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
|||
|
||||
switch appRoute {
|
||||
case .room, .roomDetails, .roomList:
|
||||
roomFlowCoordinator.handleAppRoute(appRoute, animated: true)
|
||||
roomFlowCoordinator.handleAppRoute(appRoute, animated: animated)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -242,7 +242,29 @@ class ClientProxy: ClientProxyProtocol {
|
|||
}
|
||||
|
||||
func roomForIdentifier(_ identifier: String) async -> RoomProxyProtocol? {
|
||||
let (slidingSyncRoom, room) = await Task.dispatch(on: clientQueue) {
|
||||
// Try fetching the room from the cold cache (if available) first
|
||||
var (slidingSyncRoom, room) = await Task.dispatch(on: clientQueue) {
|
||||
self.roomTupleForIdentifier(identifier)
|
||||
}
|
||||
|
||||
if let slidingSyncRoom, let room {
|
||||
return await RoomProxy(slidingSyncRoom: slidingSyncRoom,
|
||||
room: room,
|
||||
backgroundTaskService: backgroundTaskService)
|
||||
}
|
||||
|
||||
// Else wait for the visible rooms list to go into fully loaded
|
||||
|
||||
guard let visibleRoomsSummaryProvider else {
|
||||
MXLog.error("Visible rooms summary provider not setup yet")
|
||||
return nil
|
||||
}
|
||||
|
||||
if visibleRoomsSummaryProvider.statePublisher.value != .fullyLoaded {
|
||||
_ = await visibleRoomsSummaryProvider.statePublisher.values.first(where: { $0 == .fullyLoaded })
|
||||
}
|
||||
|
||||
(slidingSyncRoom, room) = await Task.dispatch(on: clientQueue) {
|
||||
self.roomTupleForIdentifier(identifier)
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class ExpiringTaskRunnerTests: XCTestCase {
|
|||
}
|
||||
|
||||
do {
|
||||
let result = try await runner.run(timeout: .seconds(1))
|
||||
_ = try await runner.run(timeout: .seconds(1))
|
||||
} catch {
|
||||
XCTAssertEqual(error as? ExpiringTaskTestError, ExpiringTaskTestError.failed)
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class ExpiringTaskRunnerTests: XCTestCase {
|
|||
}
|
||||
|
||||
do {
|
||||
let result = try await runner.run(timeout: .milliseconds(100))
|
||||
_ = try await runner.run(timeout: .milliseconds(100))
|
||||
} catch {
|
||||
XCTAssertEqual(error as? ExpiringTaskRunnerError, ExpiringTaskRunnerError.timeout)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue