Sliding sync tweaks (#470)

* Show the splash screen again after failing to restore a session

* Fix visible rooms cold cache not working. Construct the visibleRoomsView before calling the sliding sync builder, process invalid entries directly if the allRoomsView is not available

* Stop building custom identifiers for invalidated rooms, we still have duplicates coming from filled ones.

* Fix visibleItemRangePublisher debouncer, guard against changing the range while the view isn't "live" yet

* Add more logs
This commit is contained in:
Stefan Ceriu
2023-01-18 17:13:44 +02:00
committed by GitHub
parent 12c9e27056
commit 6615116226
4 changed files with 113 additions and 75 deletions
@@ -143,6 +143,7 @@ class AppCoordinator: AppCoordinatorProtocol {
self.restoreUserSession()
case (.restoringSession, .failedRestoringSession, .signedOut):
self.showLoginErrorToast()
self.presentSplashScreen(isSoftLogout: false)
case (.restoringSession, .succeededRestoringSession, .signedIn):
self.hideLoadingIndicator()
self.setupUserSession()
@@ -390,6 +391,8 @@ class AppCoordinator: AppCoordinatorProtocol {
@objc
private func applicationWillResignActive() {
MXLog.info("Application will resign active")
guard backgroundTask == nil else {
return
}
@@ -404,6 +407,8 @@ class AppCoordinator: AppCoordinatorProtocol {
@objc
private func applicationDidBecomeActive() {
MXLog.info("Application did become active")
backgroundTask?.stop()
backgroundTask = nil
@@ -416,6 +421,8 @@ class AppCoordinator: AppCoordinatorProtocol {
private func observeNetworkState() {
let reachabilityNotificationIdentifier = "io.element.elementx.reachability.notification"
ServiceLocator.shared.networkMonitor.reachabilityPublisher.sink { reachable in
MXLog.info("Reachability changed to \(reachable)")
if reachable {
ServiceLocator.shared.userNotificationController.retractNotificationWithId(reachabilityNotificationIdentifier)
} else {