Adopt sliding sync versions for client Restoration.

This commit is contained in:
Doug
2024-08-29 11:50:06 +01:00
committed by Stefan Ceriu
parent 143b560454
commit ef2fd1e0d2
11 changed files with 349 additions and 204 deletions

View File

@@ -88,7 +88,6 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
do {
Self.userSession = try await NSEUserSession(credentials: credentials,
clientSessionDelegate: keychainController,
simplifiedSlidingSyncEnabled: settings.simplifiedSlidingSyncEnabled,
appHooks: appHooks)
} catch {
MXLog.error("Failed creating user session with error: \(error)")

View File

@@ -18,7 +18,6 @@ import Foundation
protocol NSESettingsProtocol {
var logLevel: TracingConfiguration.LogLevel { get }
var simplifiedSlidingSyncEnabled: Bool { get }
}
extension AppSettings: NSESettingsProtocol { }

View File

@@ -26,7 +26,7 @@ final class NSEUserSession {
networkMonitor: nil)
private let delegateHandle: TaskHandle?
init(credentials: KeychainCredentials, clientSessionDelegate: ClientSessionDelegate, simplifiedSlidingSyncEnabled: Bool, appHooks: AppHooks) async throws {
init(credentials: KeychainCredentials, clientSessionDelegate: ClientSessionDelegate, appHooks: AppHooks) async throws {
userID = credentials.userID
if credentials.restorationToken.passphrase != nil {
MXLog.info("Restoring client with encrypted store.")
@@ -36,7 +36,7 @@ final class NSEUserSession {
let clientBuilder = ClientBuilder
.baseBuilder(setupEncryption: false,
httpProxy: URL(string: homeserverURL)?.globalProxy,
slidingSync: simplifiedSlidingSyncEnabled ? .simplified : .restored,
slidingSync: .restored,
sessionDelegate: clientSessionDelegate,
appHooks: appHooks)
.sessionPaths(dataPath: credentials.restorationToken.sessionDirectory.path(percentEncoded: false),