Skip to content

Add hidden tokens to store#9320

Merged
rekmarks merged 8 commits intoMetaMask:developfrom
PatrykLucka:add-hidden-tokens
Dec 8, 2020
Merged

Add hidden tokens to store#9320
rekmarks merged 8 commits intoMetaMask:developfrom
PatrykLucka:add-hidden-tokens

Conversation

@PatrykLucka
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

miranda76
miranda76 previously approved these changes Sep 21, 2020
Copy link
Copy Markdown
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:

@darkwing
Copy link
Copy Markdown
Contributor

darkwing commented Nov 9, 2020

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

@brad-decker
Copy link
Copy Markdown
Contributor

@rekmarks I think this is ready for another look

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@tmashuang
Copy link
Copy Markdown
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