MetaMask / MetaMask/metamask-extension

Enhance Remote Feature Flag Overrides for Controller-Level Integration

Open
#31,699 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

for-migration mig-epic-5-child team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### What is this about?

Extend the current remote feature flag override functionality to directly inject overrides into the `RemoteFeatureFlagController`, allowing for comprehensive testing of controller-level integrations without requiring network request mocking.

**Override Precedence (Highest to Lowest)**

1. Controller-level overrides - Passed directly to the controller constructor
2. App-level overrides - From `.manifest-overrides.json` at app startup
3. Network-fetched values - The actual remote feature flag values from the LaunchDarkly server

### Scenario

_No response_

### Design

_No response_

### Technical Details

Add an optional constructor parameter to RemoteFeatureFlagController that allows direct injection of feature flag overrides:
```
const controller = new RemoteFeatureFlagController({
// Other existing options
featureFlagOverrides: {
// Object containing flag overrides
"feature1": true,
"feature2": false
}
});
```

**Implementation Notes**

- The controller should prioritize injected overrides over network-fetched values
- This approach keeps the controller agnostic of manifest files or specific file formats
- Existing override functionality should continue to work as before

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the RemoteFeatureFlagController entry point and trace the existing app-level manifest override handling and network-fetched values. Review the controller's existing tests before changing its constructor. Done means injected overrides take precedence, existing override behavior remains intact, and controller-level integration coverage verifies the precedence order.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.