-
Notifications
You must be signed in to change notification settings - Fork 46
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
fix: rpc networks are tested after selection to make sure they are functional #209
fix: rpc networks are tested after selection to make sure they are functional #209
Conversation
app.provider = await useFastestRpc(app); | ||
} catch (e) { | ||
toaster.create("error", `${e}`); | ||
} | ||
if (ethereum) { |
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.
I'm having second thoughts about myself having had renamed window.ethereum to ethereum. Could be shadowed easily 😰
I'm not sure if there are any pitfalls with the built in RPC provider like if the wallet MUST be connected to the app already. If it's a big project I'm ready to merge this pull as is. Otherwise please include that adjustment! |
I think the api is standardized. It's like |
it's standardized across providers and if multiple are used then [EIP-6963) (https://eips.ethereum.org/EIPS/eip-6963) can help with that but not really applicable here
|
@gentlementlegen just wanted to confirm that this fix works and I'm happy to see it self healed my claims ability in my iOS MetaMask! |
@gentlementlegen this is probably why we have this problem. Currently manually testing each commit locally. I can't reproduce this from a IP address URL. |
I think I understand the root of the issue. Because there is no wallet connected the fetch to the chain always fails and it ends up having no instance returned hence leading to the infinite loading screen. I think the whole flow should be reviewed to avoid this. Quick fix would be by default to return the first item of the list. But this also means that on network failure or on unreachable rpc we will have the same network issue as we had before this fix. To reproduce this on a PC disconnecting the wallet should trigger a similar behavior probably. Otherwise locally connect with a mobile device. |
Resolves #205