From 51cd2d5ef365a38f3d346dd8542b0a91e76740bb Mon Sep 17 00:00:00 2001 From: Prithpal Sooriya Date: Wed, 4 Feb 2026 15:28:55 +0000 Subject: [PATCH] chore(runway): cherry-pick fix: default explore feature to enabled cp-7.64.0 (#25608) ## **Description** This unblocks this issue https://github.com/MetaMask/metamask-mobile/issues/25474 The underlying issue is that the remote feature flag controller does not reset cache on version upgrades, so users will need to close their app and wait for the feature flag cache to expire before they can see the new feature. However the remote feature flag controller change would be pretty large, so to keep the scope small (and because the explore feature is released) we will be hardcoding the feature flag to true. ## **Changelog** CHANGELOG entry: fix: default explore feature to enabled ## **Related issues** Fixes: https://github.com/MetaMask/metamask-mobile/issues/25474 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** ### **Before** ### **After** https://www.loom.com/share/a9112c646381436898a7bcd63c7ab028 ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- Open in Cursor Open in Web --- > [!NOTE] > **Medium Risk** > Forces a feature flag to default-on for most builds, which can unintentionally enable UI/flows for users regardless of remote rollout state; limited scope but impacts runtime behavior. E2E behavior is explicitly preserved via `isE2E` gating. > > **Overview** > **Defaults the Explore/Trending Tokens feature to enabled** by injecting a selector-level override: `selectAssetsTrendingTokensEnabled` now forces the env override to `'true'` for non-E2E builds, bypassing remote-flag caching/version rollout delays. > > Updates tests to mock `isE2E` and refreshes `MainNavigator` snapshots to include the `ExploreSearch`, `SitesFullView`, and `BrowserTabHome` routes. > > Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eaed767dfe9302d1b25bb3306372428ae0d54fcc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot). --- .../__snapshots__/MainNavigator.test.tsx.snap | 99 +++++++++++++++++++ .../assetsTrendingTokens/index.test.ts | 4 + .../assetsTrendingTokens/index.ts | 6 +- 3 files changed, 108 insertions(+), 1 deletion(-) diff --git a/app/components/Nav/Main/__snapshots__/MainNavigator.test.tsx.snap b/app/components/Nav/Main/__snapshots__/MainNavigator.test.tsx.snap index 368fe07c006..c12fbb09e66 100644 --- a/app/components/Nav/Main/__snapshots__/MainNavigator.test.tsx.snap +++ b/app/components/Nav/Main/__snapshots__/MainNavigator.test.tsx.snap @@ -253,6 +253,39 @@ exports[`MainNavigator Tab Bar Visibility hides tab bar when browser is active 1 } } /> + + + + + + + + + ({ init: () => mockedEngine.init(), })); +jest.mock('../../../util/test/utils', () => ({ + isE2E: true, +})); + beforeEach(() => { jest.clearAllMocks(); }); diff --git a/app/selectors/featureFlagController/assetsTrendingTokens/index.ts b/app/selectors/featureFlagController/assetsTrendingTokens/index.ts index e931a1017f6..b1077b349e4 100644 --- a/app/selectors/featureFlagController/assetsTrendingTokens/index.ts +++ b/app/selectors/featureFlagController/assetsTrendingTokens/index.ts @@ -2,6 +2,7 @@ import { createSelector } from 'reselect'; import { selectRemoteFeatureFlags } from '..'; import compareVersions from 'compare-versions'; import packageJson from '../../../../package.json'; +import { isE2E } from '../../../util/test/utils'; const APP_VERSION = packageJson.version; @@ -81,6 +82,9 @@ export const isAssetsTrendingTokensFeatureEnabled = ( return evaluateAssetsTrendingTokensRemoteFlag(flagValue); }; +// We are enabling this feature flag to be enabled by default for non-E2E builds +const forcedTrueOverride = () => (!isE2E ? 'true' : undefined); + /** * Selector to check if the assets trending tokens feature flag is enabled. * Supports environment variable override (OVERRIDE_REMOTE_FEATURE_FLAGS + ASSETS_TRENDING_TOKENS_ENABLED). @@ -103,7 +107,7 @@ export const selectAssetsTrendingTokensEnabled = createSelector( return isAssetsTrendingTokensFeatureEnabled( value, - envOverride || undefined, + forcedTrueOverride() || envOverride || undefined, ); }, );