-
Notifications
You must be signed in to change notification settings - Fork 42
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
wallet provider management #242
Conversation
I've updated the PR body with some info and debugging infos but the tldr is:
because |
Make the logs way less verbose. You shouldn't show every test unless its happening very slowly (it shouldn't) Also for the RPC that works- can you make it a clickable link to pre-fill the network details on MetaMask? I'm pretty sure i've seen this capability on Chainlist.org etc. In this case I would display something more like:
...and thats it. gnosis.drpc.org should be a link to pre-fill all the RPC information on MetaMask. |
@0x4007 I've tried on mobile to see if that feature works but it doesn't it's the same as the app is now. On desktop chainlist will call Since it works on desktop and does add the network for you the same way chainlist does the only option for mobile realistically is the url to copy paste, maybe a helper button to copy to clipboard but beyond that I don't see how we could make it easier for mobile. I will make it less verbose |
Because the call to actually add the RPC is a But because of the fact it works on desktop and just not on mobile, I don't think it makes sense to do that because either way it serves no utility.
Never a truer statement |
What is your conclusion on the solution here? |
Desktop: it works, so no need to show a toast or manual method. Mobile: Until the MM mobile browser issue is resolved we cannot directly change their RPC no matter what if we are considering the default browser to be MM. Only they can do it, so improving QOL for them would be making it easier to copy the toast via a "click" as opposed the standard way of copying. Although personally I don't think that is even required. RPCs can be pretty long so then we need to jam a button/icon for them to press into the already tight-for-space mobile notification and I think it's easy and intuitive enough on mobile for users to press and hold, drag and copy. There is no excellent solution for this just yet. I will stay on-top of the MM issue and when it's resolved we should only need to remove the media query checks and both envs should perform the same |
Given that they have 167 open sev2-normal issues and given that it took them two weeks to close out the only So then lets just accomodate users to be able to manually copy and paste the values and be done with this. |
That's wild. They could be doing with a Ubiquibot install. And what's the chances that it's you who opened the only sev0 issue 😂
This is how things are at the moment |
I went with the userAgent regex as that seemed to be the most robust and I verified that it works as expected |
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.
Code seems fine. Although I'm not entirely sure what the best way to test this is. @rndquu can you take a quick review to finalize this pull?
I can only test manually with iOS without setting up a testing framework that can handle mobile better than Cypress |
@rndquu rfc |
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.
Works fine
@Keyrxng Pls resolve conflicts and merge this PR |
@rndquu Do you think it is right to have a If we pin |
As far as I remember this issue is solved with this CI step for yarn v4 |
Resolves #241
https://www.github.com/MetaMask/metamask-mobile/issues/9519
A known issue is stopping us from being able to change the in-wallet RPC ourselves right now so the next best thing is to suggest they replace it themselves and serve an infinite toast.
Me trying to use
wallet_addEthereumChain
and getting{}
which is expected when this call succeeds.Repeating the same call with an incorrect args throws an error as expected.
This is what a user will see if we need to suggest something to them. The bottom-most toast being infinite.
It has been difficult trying to reproduce, debug and think of how to implement effective tests for this. MM won't save an RPC that it cannot connect to itself, so you are relying on connecting to an RPC which is up but often goes down and then it happening while you are spamming refresh.
I was forcing the results through
if(true)
after I gave up trying to reproduce.You see here that MM is indeed firing these calls to the in-wallet RPC
so it is testing it.
On desktop the automatic change goes through as you would expect, no muss no fuss.
So until the known issue is resolved it's best to just suggest that a user manually change their in-wallet RPC.