feat: add metaMetricsIds explicit targeting to threshold feature flags#9340
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0a800c3. Configure here.
dan437
previously approved these changes
Jul 3, 2026
83e2b47 to
85e3940
Compare
Strip metaMetricsIds from processedFlags before writing them to remoteFeatureFlags state and #processedRemoteFeatureFlags. Previously, metaMetricsIds were only redacted from rawRemoteFeatureFlags, but threshold arrays preserved as-is (e.g. when metaMetricsId is not available) would leak explicit-targeting IDs into state, logs, and debug snapshots. Also fixes Prettier formatting and updates changelog PR link.
Fixes jest/no-conditional-expect lint failure by asserting the resolved flag shape directly, since explicit-ID matches always resolve to an object. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…old flags Rebase onto main's breaking change (#9289) that returns the selected threshold value directly instead of wrapping it in { name, value }, storing the selected group name in featureFlagThresholdGroups instead.
85e3940 to
c77249e
Compare
DDDDDanica
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
metaMetricsIds?: string[]field toFeatureFlagScopeValuein the remote feature flag controller typesmetaMetricsIdslist, that entry is selected immediately, bypassing hash-based rolloutmetaMetricsIdsvalues are redacted fromrawRemoteFeatureFlagsbefore persisting to state, so they never appear in state logs or debug snapshotsBehaviour
metaMetricsIds(non-array) are silently skipped; those entries still participate in hash-based selectionTest plan
metaMetricsIds explicit targetingdescribe block covers: exact match, first-match-wins, hash fallback, malformed entries, non-string items, normalization, cache bypass, cache fallback population, state redaction, and ThresholdVersion.DirectValue compatibilityNote
Medium Risk
Changes core threshold selection and persists redacted flag payloads; misconfigured remote
metaMetricsIdscould steer specific users in production, though hash rollout and local overrides behavior remain.Overview
Adds optional
metaMetricsIdson threshold flag entries so QA/PM users can be pinned to a variant before hash-based rollout runs.Threshold processing now checks
findExplicitIdMatchfirst (trim + case-insensitive ID compare, first matching entry wins, malformed lists skipped); on match it resolves the entry’svalueand optional groupnamewithout writingthresholdCache. Otherwise behavior is unchanged: hash threshold + cache.redactMetaMetricsIdsstrips targeting lists fromrawRemoteFeatureFlagsand processedremoteFeatureFlagsbefore state persistence so IDs do not appear in logs or debug snapshots. Types and changelog are updated; a large test suite covers match, fallback, cache, redaction, andThresholdVersion.DirectValue.Reviewed by Cursor Bugbot for commit c77249e. Bugbot is set up for automated code reviews on this repo. Configure here.