mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Potential fix for a crash when 2 present room events are sent in quick succession. (#3001)
This commit is contained in:
@@ -214,6 +214,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
|||||||
fatalError("Trying to create different room proxies for the same flow coordinator")
|
fatalError("Trying to create different room proxies for the same flow coordinator")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MXLog.warning("Found an existing proxy, returning.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,9 +222,12 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
|||||||
fatalError("Requesting room details for an unjoined room")
|
fatalError("Requesting room details for an unjoined room")
|
||||||
}
|
}
|
||||||
|
|
||||||
self.roomProxy = roomProxy
|
|
||||||
|
|
||||||
await roomProxy.subscribeForUpdates()
|
await roomProxy.subscribeForUpdates()
|
||||||
|
|
||||||
|
// Make sure not to set this until after the subscription has succeeded, otherwise the
|
||||||
|
// early return above could result in trying to access the room's timeline provider
|
||||||
|
// before it has been set which triggers a fatal error.
|
||||||
|
self.roomProxy = roomProxy
|
||||||
}
|
}
|
||||||
|
|
||||||
// swiftlint:disable:next function_body_length
|
// swiftlint:disable:next function_body_length
|
||||||
|
|||||||
Reference in New Issue
Block a user