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

Add hidden tokens to store #9320

Merged
merged 8 commits into from
Dec 8, 2020
Merged

Conversation

PatrykLucka
Copy link
Contributor

PR adds hidden tokens to store, to prevent adding them automatically if balance > 0 is detected.
Fixes #5055

@PatrykLucka PatrykLucka requested a review from a team as a code owner August 28, 2020 09:29
@PatrykLucka PatrykLucka requested a review from danjm August 28, 2020 09:29
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2020

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.

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

The code looks good to me!

The only reservation I have is that this list of hidden tokens isn't visible to the user. This could be confusing, especially considering our old behaviour. Maybe we could add it in settings somewhere? 🤔

Or perhaps this is fine for now, and we can add UI later as an enhancement?

app/scripts/controllers/preferences.js Outdated Show resolved Hide resolved
miranda76
miranda76 previously approved these changes Sep 21, 2020
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

Regardless of how this goes, we have some follow-up work to do:

app/scripts/controllers/preferences.js Outdated Show resolved Hide resolved
app/scripts/controllers/preferences.js Show resolved Hide resolved
@darkwing
Copy link
Contributor

darkwing commented Nov 9, 2020

Oops, this is failing one test. Please have another look @PatrykLucka ! Thank you!

@brad-decker
Copy link
Contributor

@rekmarks I think this is ready for another look

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

There are a number of methods in the preferences controller related to adding, removing, or otherwise modifying identies/accounts, and they modify accountTokens. Shouldn't we also modify accountHiddenTokens in these cases?

@PatrykLucka
Copy link
Contributor Author

@rekmarks you're right, I updated preferences controller, please take a look.

@tmashuang
Copy link
Contributor

tmashuang commented Dec 8, 2020

From a behavioral standpoint this PR fixes the issue with tracking, and persisting, tokens that the user hides. Whether we can/should optimize this to prevent duplicates of the accountHiddenTokens and hiddenToken is a point of contention, but it acts similiarly to how we track tokens and accountTokens.

Also to note, for tokens under a custom network there is no way to distinguish different sets of custom network hidden tokens, they are all under the rpc property, same as accountTokens.

LGTM!

@rekmarks rekmarks merged commit e4a77e1 into MetaMask:develop Dec 8, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hidden tokens re-appear
8 participants