Skip to content
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

chore: disable protect modal in development #10110

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dbrans
Copy link
Contributor

@dbrans dbrans commented Jun 25, 2024

Description

This PR disables the "Protect your wallet" blocking modal when NODE_ENV is 'development'
image

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

@dbrans dbrans requested a review from a team as a code owner June 25, 2024 12:37
Copy link
Contributor

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.

@dbrans dbrans added the team-transactions Transactions team label Jun 25, 2024
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jun 25, 2024
@@ -949,6 +949,11 @@ class DrawerView extends PureComponent {
};

renderProtectModal = () => {
const NODE_ENV = 'NODE_ENV';
Copy link
Member

Choose a reason for hiding this comment

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

Can all this be encapsulated in a util such as isDevBuild assuming one doesn't already exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea. Done.

@tommasini
Copy link
Contributor

I don't know if it's a good idea to hide this always when it's development, we identified recently bug on that modal, if we apply this we will always miss if any bug is present during development
I think we could create a variable for this but one specific
Open to more thoughts

Copy link

@dbrans
Copy link
Contributor Author

dbrans commented Jun 25, 2024

I don't know if it's a good idea to hide this always when it's development, we identified recently bug on that modal, if we apply this we will always miss if any bug is present during development I think we could create a variable for this but one specific Open to more thoughts

@tommasini I think this could be a good improvement: default the modal to off during development. Developers who need to debug it can just comment out a line as they do now. What do you think?

@tommasini
Copy link
Contributor

tommasini commented Jun 25, 2024

I think this could be a good improvement: default the modal to off during development. Developers who need to debug it can just comment out a line as they do now. What do you think?

If I understood correctly you are suggesting that the default behaviour is to hide the protect modal to funded not backed up accounts.
I am not sure just because we don't have anything educating the engineers that this was a feature, some of the new engineers probably don't know it, and if we turn this on by default for not showing the protect modal, I'm afraid they can only discover when they create a bug on it! Sorry, I am just trying to think how this could go wrong, If more team members (QA team included) are okay with this, I'm OK with moving this further!

Comment on lines +1 to +4
const NODE_ENV = 'NODE_ENV';

// eslint-disable-next-line import/prefer-default-export
export const isDevelopment = () => process.env[NODE_ENV] === 'development';
Copy link
Contributor

Choose a reason for hiding this comment

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

S: we may not realy need a const on this as it's only used once and in s very specific scope (envs).
I suggest the following:

Suggested change
const NODE_ENV = 'NODE_ENV';
// eslint-disable-next-line import/prefer-default-export
export const isDevelopment = () => process.env[NODE_ENV] === 'development';
export const isDevelopment = () => process.env['NODE_ENV'] === 'development';

Also prefer default export is not a rule anymore.

@legobeat
Copy link
Contributor

legobeat commented Sep 30, 2024

If it's too onerous for devs to force this behavior, likely that's an indication it is also too arduous for many users as well?

If we solve a UX regression for internal users, shouldn't we solve it for other users at the same time?

Could it perhaps be toggled via "Settings" as a runtime setting, rather than as build-time configuration?

@NicolasMassart
Copy link
Contributor

Just going back on this, I have an idea: the issue is currently that there's no way to escape this modal an once you have it you don't have other choice than saving SRP.
What about a button to ignore for some time, like os upgrade, but have this forced after say 10 ignores. That would allow devs enough time to test things.
The modal would show each time we open the foreground the app on the wallet view.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-confirmations Push issues to confirmations team team-transactions Transactions team
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

6 participants