mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Remove the event cache feature flag, it's enabled by default on the SDK and we haven't had any bug reports for it.
This commit is contained in:
@@ -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 { }
|
||||
|
||||
@@ -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
|
||||
|
||||
-1
@@ -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 { }
|
||||
|
||||
+1
-10
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user