-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: use METAMASK_ENVIRONMENT instead of NODE_ENV #22282
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
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. |
| /> | ||
| )} | ||
| {process.env.NODE_ENV !== 'production' && ( | ||
| {process.env.METAMASK_ENVIRONMENT !== '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.
Bug: Defaulting environment check reveals feature flag override dashboard
When METAMASK_ENVIRONMENT is undefined, the condition evaluates to true because undefined !== 'production', incorrectly showing the Feature Flag Override dashboard. This differs from the original NODE_ENV behavior which typically has a default value. The safer approach would be to explicitly check for non-production values or provide a default.
| }} | ||
| /> | ||
| {process.env.NODE_ENV !== 'production' && ( | ||
| {process.env.METAMASK_ENVIRONMENT !== '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.
Bug: Non-Production Burn-In Flag Activation Bug
When METAMASK_ENVIRONMENT is undefined, the condition evaluates to true because undefined !== 'production', incorrectly registering the Feature Flag Override screen. This differs from the original NODE_ENV behavior which typically has a default value. The safer approach would be to explicitly check for non-production values or provide a default.
e4418ee to
3aa2b34
Compare
47d2410 to
ac01b7c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22282 +/- ##
==========================================
+ Coverage 77.86% 77.88% +0.02%
==========================================
Files 3826 3823 -3
Lines 98105 97831 -274
Branches 19236 19211 -25
==========================================
- Hits 76389 76200 -189
+ Misses 16480 16397 -83
+ Partials 5236 5234 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



Description
Use metamask enviornment variable instead of node_env to view feature override dashboard
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Switches visibility gating from NODE_ENV to METAMASK_ENVIRONMENT for Feature Flag Override screens and adds tests; also memoizes feature flag context helpers.
process.env.NODE_ENV !== 'production'withprocess.env.METAMASK_ENVIRONMENT !== 'production'to conditionally showRoutes.FEATURE_FLAG_OVERRIDEinMainNavigatorand the Feature Flag Override drawer inViews/Settings.MainNavigator.test.tsxandViews/Settings/index.test.tsxto useMETAMASK_ENVIRONMENT, including setup/teardown of env var and assertions that Feature Flag Override is present in non-production.featureFlagsList,getFeatureFlag, and the provided context value viauseMemo/useCallback.process.env.METAMASK_ENVIRONMENTin minimum version validation.Written by Cursor Bugbot for commit 1ab6560. This will update automatically on new commits. Configure here.