Add a feature flag for the event cache.

This commit is contained in:
Benoit Marty
2024-12-12 11:40:53 +01:00
parent b3e64bd526
commit b2dce57abe
2 changed files with 8 additions and 3 deletions

View File

@@ -161,4 +161,11 @@ enum class FeatureFlags(
defaultValue = { buildMeta -> buildMeta.buildType != BuildType.RELEASE },
isFinished = false,
),
EventCache(
key = "feature.event_cache",
title = "Use SDK Event cache",
description = "Warning: you must kill and restart the app for the change to take effect.",
defaultValue = { false },
isFinished = false,
),
}

View File

@@ -109,9 +109,7 @@ class RustMatrixClientFactory @Inject constructor(
.addRootCertificates(userCertificatesProvider.provides())
.autoEnableBackups(true)
.autoEnableCrossSigning(true)
// TODO Add a feature flag to enable persistent storage
// See https://github.com/matrix-org/matrix-rust-sdk/pull/4396
.useEventCachePersistentStorage(false)
.useEventCachePersistentStorage(featureFlagService.isFeatureEnabled(FeatureFlags.EventCache))
.roomKeyRecipientStrategy(
strategy = if (featureFlagService.isFeatureEnabled(FeatureFlags.OnlySignedDeviceIsolationMode)) {
CollectStrategy.IdentityBasedStrategy