Skip to content

Commit 0d2efe5

Browse files
committed
Add a feature flag for the event cache.
1 parent a665517 commit 0d2efe5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,11 @@ enum class FeatureFlags(
161161
defaultValue = { buildMeta -> buildMeta.buildType != BuildType.RELEASE },
162162
isFinished = false,
163163
),
164+
EventCache(
165+
key = "feature.event_cache",
166+
title = "Use SDK Event cache",
167+
description = "Warning: you must kill and restart the app for the change to take effect.",
168+
defaultValue = { false },
169+
isFinished = false,
170+
),
164171
}

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ class RustMatrixClientFactory @Inject constructor(
109109
.addRootCertificates(userCertificatesProvider.provides())
110110
.autoEnableBackups(true)
111111
.autoEnableCrossSigning(true)
112-
// TODO Add a feature flag to enable persistent storage
113-
// See https://github.com/matrix-org/matrix-rust-sdk/pull/4396
114-
.useEventCachePersistentStorage(false)
112+
.useEventCachePersistentStorage(featureFlagService.isFeatureEnabled(FeatureFlags.EventCache))
115113
.roomKeyRecipientStrategy(
116114
strategy = if (featureFlagService.isFeatureEnabled(FeatureFlags.OnlySignedDeviceIsolationMode)) {
117115
CollectStrategy.IdentityBasedStrategy

0 commit comments

Comments
 (0)