-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement remote feature flag controller #12427
Conversation
allow remote feature flag controller symlink to get bundled by metro
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. |
5e9991d
to
6f8d208
Compare
74b9b88
to
9a67929
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update tests please
app/core/Engine/controllers/RemoteFeatureFlagController/utils.test.ts
Outdated
Show resolved
Hide resolved
app/core/Engine/controllers/RemoteFeatureFlagController/utils.test.ts
Outdated
Show resolved
Hide resolved
app/core/Engine/controllers/RemoteFeatureFlagController/utils.test.ts
Outdated
Show resolved
Hide resolved
app/core/Engine/controllers/RemoteFeatureFlagController/utils.test.ts
Outdated
Show resolved
Hide resolved
app/core/Engine/controllers/RemoteFeatureFlagController/utils.test.ts
Outdated
Show resolved
Hide resolved
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
I've revisited the controller initialisation testing.
For the selector, the unit test names were updated Thanks for your review @NicolasMassart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allowing myself to fix some typos and missing 'when' directly
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
app/core/Engine/controllers/RemoteFeatureFlagController/utils.test.ts
Outdated
Show resolved
Hide resolved
app/selectors/featureFlagController/minimumAppVersion/index.test.ts
Outdated
Show resolved
Hide resolved
…st.ts Co-authored-by: Nico MASSART <[email protected]>
…test.ts Co-authored-by: Nico MASSART <[email protected]>
…st.ts Co-authored-by: Nico MASSART <[email protected]>
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me on the code side.
Description
Introduction of
@metamask/remote-feature-flag-controller
library.Remote feature flag controller manages data flow, retry policy, and cache expiry.
The controller consumer manages default values, data persistency, and data distribution.
See ADR for a in-depth description
Technical decisions
Controller init on
Engine.ts
with feature flags fetching only on cold app starts.@metamask/remote-feature-flag-controller
is only asked to fetch feature flags after its init inEngine.ts
. Ensures feature flags are only fetched on cold app starts.Fallback values
Default values are used when remote feature flags are undefined.
The fallback mechanism is implemented by each feature flag selector
app/selectors/featureFlagsController/<featureFlagName>
In this PR we include
minimumAppVersion
selector, which manages the LD feature flagmobile-minimum-versions
One selector per each feature flag
LD feature flags can be boolean, number, strings on JSON objects.
We've decided to have each feature flag with its own selector
A feature flag selector contains:
This architecture offers a clear separation between each feature flag and the logic behind it, allowing easier manipulation.
Code owners are assigned to each feature flag.
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2054
Fixes: https://github.com/MetaMask/mobile-planning/issues/1975
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist