Skip to content

Conversation

@NicolasMassart
Copy link
Contributor

@NicolasMassart NicolasMassart commented Jan 8, 2026

Description

This reverts the changes from PR #24178 that added automatic tracking of remote feature flags to user traits via addTraitsToUser.
Automatic Github revert not available for this PR.

Reverted changes:

  • Removed useEffect hook that called addTraitsToUser with rawFeatureFlags
  • Removed useMetrics import and addTraitsToUser usage
  • Removed related unit tests for feature flag user traits tracking

Related

Reverts #24178

Changelog

CHANGELOG entry: null

Related issues

Reverts #24178

Manual testing steps

Identify calls should be sent to Segment server again.

Screenshots/Recordings

NA

Before

NA

After

NA

Pre-merge author checklist

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.

Note

Reverts automatic syncing of remote feature flags to user traits.

  • Removes useMetrics import and the useEffect that called addTraitsToUser(rawFeatureFlags) in FeatureFlagOverrideContext.tsx
  • Deletes related unit tests and mocks in FeatureFlagOverrideContext.test.tsx for bulk/add-on-change trait updates
  • Keeps feature flag override functionality (set/remove/clear) intact

Written by Cursor Bugbot for commit 27ec9cd. This will update automatically on new commits. Configure here.

This reverts the changes from PR #24178 that added automatic tracking
of remote feature flags to user traits via addTraitsToUser.

Reverted changes:
- Removed useEffect hook that called addTraitsToUser with rawFeatureFlags
- Removed useMetrics import and addTraitsToUser usage
- Removed related unit tests for feature flag user traits tracking
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts the automatic tracking of remote feature flags to user traits that was introduced in PR #24178. The revert removes the feature flag tracking functionality while preserving all core feature flag override APIs and processing logic.

  • Removes automatic user trait tracking when feature flags are loaded or changed
  • Eliminates the useMetrics hook dependency from the FeatureFlagOverrideContext
  • Removes all associated unit tests for the reverted feature flag tracking functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/contexts/FeatureFlagOverrideContext.tsx Removed useEffect import, useMetrics hook, and the effect that automatically tracked feature flags to user traits
app/contexts/FeatureFlagOverrideContext.test.tsx Removed useMetrics mock setup and all test cases covering the automatic feature flag tracking functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Looks good once the lint error is fixed

@NicolasMassart NicolasMassart changed the title revert: remove feature-flags to user traits tracking revert: remove feature-flags to user traits tracking (PR #24178) Jan 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Gudahtt
Gudahtt previously approved these changes Jan 8, 2026
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAnalytics
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

The changes remove analytics tracking functionality from the FeatureFlagOverrideContext. Specifically, the code that was calling addTraitsToUser(rawFeatureFlags) to track feature flags as user traits has been removed, along with the useMetrics hook import and the useEffect that triggered this tracking.

This is a clean removal of analytics-related code:

  1. The core feature flag override functionality (getting, setting, clearing overrides) remains completely intact
  2. The FeatureFlagOverrideProvider still works the same way for all other purposes
  3. Only the automatic analytics tracking of feature flags to user traits is removed
  4. The test file changes appropriately remove tests for the removed functionality

Since this change only affects analytics tracking and doesn't modify any user-facing features or core wallet functionality, the risk is low. The SmokeAnalytics tag is selected to verify that analytics functionality still works correctly after this change, as the removal of this tracking code could potentially affect analytics data collection patterns.

View GitHub Actions results

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

@NicolasMassart NicolasMassart added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit 9e3cb84 Jan 8, 2026
90 checks passed
@NicolasMassart NicolasMassart deleted the fix/revert-feature-flags-user-traits branch January 8, 2026 18:37
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2026
@metamaskbot metamaskbot added the release-7.62.0 Issue or pull request that will be included in release 7.62.0 label Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.62.0 Issue or pull request that will be included in release 7.62.0 size-M team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants