From 44d77a60481676933b6418c97d8edb5e58e1c779 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Thu, 15 May 2025 09:42:18 +0200 Subject: [PATCH] Remove event cache feature flag (#4719) --- .../android/features/roomlist/impl/RoomListContextMenu.kt | 2 +- .../android/features/roomlist/impl/RoomListPresenter.kt | 3 +-- .../android/features/roomlist/impl/RoomListState.kt | 2 +- .../impl/RoomListStateContextMenuShownProvider.kt | 2 +- .../features/roomlist/impl/RoomListPresenterTest.kt | 8 ++++---- .../android/libraries/featureflag/api/FeatureFlags.kt | 7 ------- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt index d95064708b..10a591bcbd 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt @@ -193,7 +193,7 @@ private fun RoomListModalBottomSheetContent( ), style = ListItemStyle.Destructive, ) - if (contextMenu.eventCacheFeatureFlagEnabled) { + if (contextMenu.displayClearRoomCacheAction) { ListItem( headlineContent = { Text(text = "Clear cache for this room") diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt index 98b5e742a2..7746f98204 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListPresenter.kt @@ -264,8 +264,7 @@ class RoomListPresenter @Inject constructor( isFavorite = event.roomSummary.isFavorite, markAsUnreadFeatureFlagEnabled = featureFlagService.isFeatureEnabled(FeatureFlags.MarkAsUnread), hasNewContent = event.roomSummary.hasNewContent, - eventCacheFeatureFlagEnabled = appPreferencesStore.isDeveloperModeEnabledFlow().first() && - featureFlagService.isFeatureEnabled(FeatureFlags.EventCache), + displayClearRoomCacheAction = appPreferencesStore.isDeveloperModeEnabledFlow().first(), ) contextMenuState.value = initialState diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListState.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListState.kt index 8d203498cb..f685d5f379 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListState.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListState.kt @@ -51,8 +51,8 @@ data class RoomListState( val isDm: Boolean, val isFavorite: Boolean, val markAsUnreadFeatureFlagEnabled: Boolean, - val eventCacheFeatureFlagEnabled: Boolean, val hasNewContent: Boolean, + val displayClearRoomCacheAction: Boolean, ) : ContextMenu } diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListStateContextMenuShownProvider.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListStateContextMenuShownProvider.kt index 4792795677..2f347a1659 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListStateContextMenuShownProvider.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListStateContextMenuShownProvider.kt @@ -31,5 +31,5 @@ internal fun aContextMenuShown( markAsUnreadFeatureFlagEnabled = true, hasNewContent = hasNewContent, isFavorite = isFavorite, - eventCacheFeatureFlagEnabled = false, + displayClearRoomCacheAction = false, ) diff --git a/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTest.kt b/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTest.kt index 073e163c16..c5d09f7656 100644 --- a/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTest.kt +++ b/features/roomlist/impl/src/test/kotlin/io/element/android/features/roomlist/impl/RoomListPresenterTest.kt @@ -297,8 +297,8 @@ class RoomListPresenterTest { isDm = false, isFavorite = false, markAsUnreadFeatureFlagEnabled = true, - eventCacheFeatureFlagEnabled = false, hasNewContent = false, + displayClearRoomCacheAction = false, ) ) } @@ -315,8 +315,8 @@ class RoomListPresenterTest { isDm = false, isFavorite = true, markAsUnreadFeatureFlagEnabled = true, - eventCacheFeatureFlagEnabled = false, hasNewContent = false, + displayClearRoomCacheAction = false, ) ) } @@ -344,8 +344,8 @@ class RoomListPresenterTest { isFavorite = false, markAsUnreadFeatureFlagEnabled = true, // true here. - eventCacheFeatureFlagEnabled = true, hasNewContent = false, + displayClearRoomCacheAction = true, ) ) } @@ -375,8 +375,8 @@ class RoomListPresenterTest { isDm = false, isFavorite = false, markAsUnreadFeatureFlagEnabled = true, - eventCacheFeatureFlagEnabled = false, hasNewContent = false, + displayClearRoomCacheAction = false, ) ) diff --git a/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt b/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt index 2a167ad774..bcffe4daf0 100644 --- a/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt +++ b/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt @@ -147,13 +147,6 @@ enum class FeatureFlags( defaultValue = { true }, 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 = { true }, - isFinished = false, - ), PrintLogsToLogcat( key = "feature.print_logs_to_logcat", title = "Print logs to logcat",