-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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(27256): implement remote feature flag feature #28684
base: main
Are you sure you want to change the base?
Conversation
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. |
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: app/scripts/background.js
Did you find this useful? React with a 👍 or 👎 |
3942cd2
to
9bddc8d
Compare
@@ -60,7 +61,7 @@ const mapStateToProps = (state, ownProps) => { | |||
const { | |||
metamask: { currencyRates }, | |||
} = state; | |||
|
|||
const remoteFeatureFlags = getRemoteFeatureFlags(state); |
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.
Will be removed after 1st feature flag is implemented in production
@@ -53,6 +57,13 @@ export default class InfoTab extends PureComponent { | |||
componentDidMount() { | |||
const { t } = this.context; | |||
handleSettingsRefs(t, t('about'), this.settingsRefs); | |||
if (this.props.remoteFeatureFlags.length > 0) { |
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.
Will be removed after 1st feature flag is implemented in production
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.
Instead of (this.props.remoteFeatureFlags.length > 0, can we use an actual feature flag. So that this becomes something like
if (this.props.remoteFeatureFlags[TEST_FLAG] > 0) {
console.log(
So we can fully demonstrate how teams would use the feature flag system?
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.
Good idea, added 5204e9c
app/scripts/background.js
Outdated
@@ -885,12 +884,16 @@ export function setupController( | |||
senderUrl?.origin === `chrome-extension://${browser.runtime.id}`; | |||
} | |||
|
|||
controller.remoteFeatureFlagController.getRemoteFeatureFlags(); |
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.
we will need error handling here now
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.
and should we remove the controller.remoteFeatureFlagController.getRemoteFeatureFlags()
call on 887, because we have one on 896?
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.
Yes this line is removed, it was for testing purpose 🙏🏻
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.
Error handling within initializeRemoteFeatureFlags
can be found 5204e9c
0e78bb0
to
e1c605a
Compare
d6d0a91
to
a2b12b6
Compare
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
a2b12b6
to
79cdc1c
Compare
3483879
to
fe30412
Compare
@metamaskbot update-policies |
Policy update failed. You can review the logs or retry the policy update here |
fe30412
to
8a0160f
Compare
@metamaskbot update-policies |
Policy update failed. You can review the logs or retry the policy update here |
8a0160f
to
b2940dd
Compare
@metamaskbot update-policies |
Policy update failed. You can review the logs or retry the policy update here |
b2940dd
to
5a8a088
Compare
This reverts commit 5a8a088.
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
948446f
to
a3f90aa
Compare
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
d30565a
to
a26c834
Compare
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Description
Related issues
Fixes: #27256
Manual testing steps
chrome.storage.local.get(console.log)
in dev tools console, and you'll find indata
=>RemoteFeatureFlagController
=> contains 2 dataset,cacheTimestamp
andremoteFeatureFlags
with valuedownload stage logs
button, you'll findremoteFeatureFlags
with cached value in your state.Feature flag fetched successfully
, which will be removed after we implement 1st feature flag in productionScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist