Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions packages/remote-feature-flag-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add optional `featureFlagThresholdGroups` field to `RemoteFeatureFlagControllerState` to map feature flag names to their selected threshold group names ([#9289](https://github.com/MetaMask/core/pull/9289))
- Add optional `featureFlagThresholdGroups` field to `RemoteFeatureFlagControllerState` to map feature flag names to their selected threshold group names ([#9325](https://github.com/MetaMask/core/pull/9325))
- Add optional `getCanonicalId` constructor callback and `FeatureFlagIdType` enum so threshold flags segment users by canonical ID by default, or by MetaMetrics ID when configured with `idType: "metametrics"` ([#9325](https://github.com/MetaMask/core/pull/9325))

### Changed

- **BREAKING:** Threshold feature flags now return the selected `value` directly instead of a `{ name, value }` wrapper. The selected threshold group name is stored separately in `featureFlagThresholdGroups` on controller state when the selected threshold entry includes `name` ([#9289](https://github.com/MetaMask/core/pull/9289))
- **BREAKING:** Threshold feature flags now return the selected `value` directly instead of a `{ name, value }` wrapper. The selected threshold group name is stored separately in `featureFlagThresholdGroups` on controller state when the selected threshold entry includes `name` ([#9325](https://github.com/MetaMask/core/pull/9325))
- Merge `localOverrides` into `remoteFeatureFlags` at the controller level so consumers receive effective flag values directly ([#9259](https://github.com/MetaMask/core/pull/9259))
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074))
- Bump `@metamask/controller-utils` from `^12.1.0` to `^12.3.0` ([#9058](https://github.com/MetaMask/core/pull/9058), [#9083](https://github.com/MetaMask/core/pull/9083), [#9218](https://github.com/MetaMask/core/pull/9218))
Expand Down
1 change: 1 addition & 0 deletions packages/remote-feature-flag-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export {
ClientType,
DistributionType,
EnvironmentType,
FeatureFlagIdType,
ThresholdVersion,
} from './remote-feature-flag-controller-types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,23 @@ export enum ThresholdVersion {
DirectValue = 2,
}

export enum FeatureFlagIdType {
MetaMetrics = 'metametrics',
Canonical = 'canonical',
}

export type FeatureFlagScopeValue = {
name: string;
/**
* Optional label for direct-value threshold entries. This replaces `name` in
* v2 configurations and is not emitted in processed controller state.
*/
thresholdName?: string;
/**
* Selects which client identifier is used for deterministic threshold
* assignment. Defaults to `canonical` when omitted.
*/
idType?: FeatureFlagIdType;
/**
* Selects the threshold entry output shape. Unrecognized versions fall back
* to the legacy `{ name, value }` wrapper for backwards compatibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick (non-blocking): This comment still says unrecognized threshold versions fall back to the legacy { name, value } wrapper, but this PR removes that behavior and now always returns the selected value directly. The documentation should be updated to match the implementation.

Expand Down
Loading
Loading