diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index 58aca09f2..f0a475967 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -19,7 +19,6 @@ protocol CommonSettingsProtocol { var enableOnlySignedDeviceIsolationMode: Bool { get } var hideInviteAvatars: Bool { get } var hideTimelineMedia: Bool { get } - var eventCacheEnabled: Bool { get } } /// Store Element specific app settings. @@ -57,7 +56,6 @@ final class AppSettings { case fuzzyRoomListSearchEnabled case enableOnlySignedDeviceIsolationMode case knockingEnabled - case eventCacheEnabledV2 } private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier @@ -343,9 +341,6 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.hideTimelineMedia, defaultValue: false, storageType: .userDefaults(store)) var hideTimelineMedia - - @UserPreference(key: UserDefaultsKeys.eventCacheEnabledV2, defaultValue: true, storageType: .userDefaults(store)) - var eventCacheEnabled } extension AppSettings: CommonSettingsProtocol { } diff --git a/ElementX/Sources/Other/Extensions/ClientBuilder.swift b/ElementX/Sources/Other/Extensions/ClientBuilder.swift index 59e8472c0..61c6de349 100644 --- a/ElementX/Sources/Other/Extensions/ClientBuilder.swift +++ b/ElementX/Sources/Other/Extensions/ClientBuilder.swift @@ -15,15 +15,13 @@ extension ClientBuilder { slidingSync: ClientBuilderSlidingSync, sessionDelegate: ClientSessionDelegate, appHooks: AppHooks, - enableOnlySignedDeviceIsolationMode: Bool, - eventCacheEnabled: Bool) -> ClientBuilder { + enableOnlySignedDeviceIsolationMode: Bool) -> ClientBuilder { var builder = ClientBuilder() .crossProcessStoreLocksHolderName(holderName: InfoPlistReader.main.bundleIdentifier) .enableOidcRefreshLock() .setSessionDelegate(sessionDelegate: sessionDelegate) .userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent()) .requestConfig(config: .init(retryLimit: 0, timeout: 30000, maxConcurrentRequests: nil, retryTimeout: nil)) - .useEventCachePersistentStorage(value: eventCacheEnabled) builder = switch slidingSync { case .restored: builder diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index ab9d5f79e..388027773 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -44,7 +44,6 @@ protocol DeveloperOptionsProtocol: AnyObject { var enableOnlySignedDeviceIsolationMode: Bool { get set } var elementCallBaseURLOverride: URL? { get set } var knockingEnabled: Bool { get set } - var eventCacheEnabled: Bool { get set } } extension AppSettings: DeveloperOptionsProtocol { } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index 83698b5ca..3c17c054d 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -30,16 +30,7 @@ struct DeveloperOptionsScreen: View { } } } - - Section("General") { - Toggle(isOn: $context.eventCacheEnabled) { - Text("Event cache") - } - .onChange(of: context.eventCacheEnabled) { - context.send(viewAction: .clearCache) - } - } - + Section("Room List") { Toggle(isOn: $context.publicSearchEnabled) { Text("Public search") diff --git a/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift b/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift index 017c838df..1d52551f6 100644 --- a/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift +++ b/ElementX/Sources/Services/Authentication/AuthenticationClientBuilder.swift @@ -48,8 +48,7 @@ struct AuthenticationClientBuilder: AuthenticationClientBuilderProtocol { slidingSync: .discover, sessionDelegate: clientSessionDelegate, appHooks: appHooks, - enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode, - eventCacheEnabled: appSettings.eventCacheEnabled) + enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode) .sessionPaths(dataPath: sessionDirectories.dataPath, cachePath: sessionDirectories.cachePath) .sessionPassphrase(passphrase: passphrase) diff --git a/ElementX/Sources/Services/UserSession/UserSessionStore.swift b/ElementX/Sources/Services/UserSession/UserSessionStore.swift index 883a4ae49..883969b0d 100644 --- a/ElementX/Sources/Services/UserSession/UserSessionStore.swift +++ b/ElementX/Sources/Services/UserSession/UserSessionStore.swift @@ -123,8 +123,7 @@ class UserSessionStore: UserSessionStoreProtocol { slidingSync: .restored, sessionDelegate: keychainController, appHooks: appHooks, - enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode, - eventCacheEnabled: appSettings.eventCacheEnabled) + enableOnlySignedDeviceIsolationMode: appSettings.enableOnlySignedDeviceIsolationMode) .sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath, cachePath: credentials.restorationToken.sessionDirectories.cachePath) .username(username: credentials.userID) diff --git a/NSE/Sources/NotificationServiceExtension.swift b/NSE/Sources/NotificationServiceExtension.swift index 614dec668..8faf8d247 100644 --- a/NSE/Sources/NotificationServiceExtension.swift +++ b/NSE/Sources/NotificationServiceExtension.swift @@ -47,17 +47,6 @@ class NotificationServiceExtension: UNNotificationServiceExtension { // Used to create one single UserSession across process/instances/runs private static let serialQueue = DispatchQueue(label: "io.element.elementx.nse") - // Temporary. We need to make sure the NSE and the main app pass in the same value. - // The NSE has a tendency of staying alive for longer so use this to manually kill it - // when the feature flag doesn't match. - private static var eventCacheEnabled = false - - private static var userSession: NSEUserSession? { - didSet { - eventCacheEnabled = settings.eventCacheEnabled - } - } - deinit { cleanUp() ExtensionLogger.logMemory(with: tag) @@ -111,11 +100,6 @@ class NotificationServiceExtension: UNNotificationServiceExtension { } } - guard Self.eventCacheEnabled == settings.eventCacheEnabled else { - MXLog.error("Found missmatch `eventCacheEnabled` feature flag missmatch, restarting the NSE.") - exit(0) - } - Task { await run(with: credentials, roomID: roomID,