Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/remote-feature-flag-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add override functionality to remote feature flags ([#7271](https://github.com/MetaMask/core/pull/7271))
- `setFlagOverride(flagName, value)` - Set a local override for a specific feature flag
- `clearFlagOverride(flagName)` - Clear the local override for a specific feature flag
- `clearAllOverrides()` - Clear all local feature flag overrides
- Add new controller state properties ([#7271](https://github.com/MetaMask/core/pull/7271))
- `localOverrides` - Local overrides for feature flags that take precedence over remote flags
- `rawProcessedRemoteFeatureFlags` - Raw flag value for arrays that were processed from arrays to single value
- Export additional controller action types ([#7271](https://github.com/MetaMask/core/pull/7271))
- `RemoteFeatureFlagControllerSetFlagOverrideAction`
- `RemoteFeatureFlagControllerClearFlagOverrideAction`
- `RemoteFeatureFlagControllerClearAllOverridesAction`

### Changed

- Enhanced feature flag processing to preserve raw A/B test arrays for visibility and override capabilities ([#7271](https://github.com/MetaMask/core/pull/7271))
Copy link
Contributor

@mcmire mcmire Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... This entry — and the category that this entry is in — make it sound like there are changes to the feature flag processing logic. But I don't see that happening — all I see are a few new methods. Unless this refers to the fact that rawRemoteFeatureFlags was added to state? Which would be covered by the point about rawRemoteFeatureFlags in "Add new controller state properties", I would think. Perhaps this is not necessary either?

Suggested change
- Enhanced feature flag processing to preserve raw A/B test arrays for visibility and override capabilities ([#7271](https://github.com/MetaMask/core/pull/7271))

- Local overrides now take precedence over remote feature flags when both exist ([#7271](https://github.com/MetaMask/core/pull/7271))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this covered by "Add override functionality to remote feature flags"? Perhaps this should be moved to a bullet point under that entry:

Suggested change
- Local overrides now take precedence over remote feature flags when both exist ([#7271](https://github.com/MetaMask/core/pull/7271))

- Controller state now includes metadata for new properties with appropriate persistence and logging settings ([#7271](https://github.com/MetaMask/core/pull/7271))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this covered by "Add new controller state properties"? Perhaps we don't need it.

Suggested change
- Controller state now includes metadata for new properties with appropriate persistence and logging settings ([#7271](https://github.com/MetaMask/core/pull/7271))


## [3.0.0]

### Added
Expand Down
3 changes: 3 additions & 0 deletions packages/remote-feature-flag-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export type {
RemoteFeatureFlagControllerActions,
RemoteFeatureFlagControllerGetStateAction,
RemoteFeatureFlagControllerUpdateRemoteFeatureFlagsAction,
RemoteFeatureFlagControllerSetFlagOverrideAction,
RemoteFeatureFlagControllerClearFlagOverrideAction,
RemoteFeatureFlagControllerClearAllOverridesAction,
RemoteFeatureFlagControllerEvents,
RemoteFeatureFlagControllerStateChangeEvent,
} from './remote-feature-flag-controller';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,25 @@ export type ServiceResponse = {
remoteFeatureFlags: FeatureFlags;
cacheTimestamp: number | null;
};

/**
* Describes the shape of the state object for the {@link RemoteFeatureFlagController}.
*/
export type RemoteFeatureFlagControllerState = {
/**
* The collection of feature flags and their respective values, which can be objects.
*/
remoteFeatureFlags: FeatureFlags;
/**
* Local overrides for feature flags that take precedence over remote flags.
*/
localOverrides: FeatureFlags;
/**
* Raw A/B test flag arrays for flags that were processed from arrays to single values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always true? Will feature flags always contain A/B test arrays from now on? There don't seem to be any changes to the FeatureFlags array, so it seems like the format continues to be quite flexible and accommodate other use cases. (I see that Cursor also commented on this.)

*/
rawProcessedRemoteFeatureFlags: FeatureFlags;
/**
* The timestamp of the last successful feature flag cache.
*/
cacheTimestamp: number;
};
Loading
Loading