-
Notifications
You must be signed in to change notification settings - Fork 363
refactor: rely on Onboard for provider watching #3364
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
E2E Tests Failed Failed tests:
|
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.
The PR looks good to me and it is easier to follow the logic with the subscriptions. I am not sure I have enough understanding of all the underlying problems to say it's ready for QA.
What problems did you find? |
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.
Nice refactor!
ESLint Summary View Full Report
Report generated by eslint-plus-action |
* fix: checksum address before ens validation * fix: checksum `verifiedAddress` * refactor: lookup ENS w/ form init
* fix: use field-level owner validation * fix: test * fix: forward compare previous owners * fix: checksum address from Onboard * fix: keep store logic in reducer
* fix: increase block polling interval * fix: patch balance `stateSyncer` out of WC * fix: upgrade `bnc-onboard` + patch `web3-provider-engine` * fix: cleanup patch * fix: cleanup patch * fix: exchange patch for custom WC module instead
Issue with WC connection. Tried in dev and prod and it doesn't happen there |
The trezor causes 2 calls to GA when connecting it, one when the modal open to select an account from the dropdown and one when you actually confirm it. This also happens in dev, but given the 1st checkbox in the description of this ticket I wanted to know if this ticket is supposed to fix these repeated calls to GA or not. |
Tested in Rinkeby so far. Signing tx with MM chrome extension, WC with MM phone app, trezor one and ledger nano S worked fine. Also safe creation |
I'm a bit confused as you're following comment:
suggests it works? Can you provide any more details?
Not here. I am working on the Analytics epic where it will be sorted. |
Let me summarize my comments:
|
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Just confirmed with @francovenica that these were solved by merging
Awaiting confirmation on whether this is related to an older ticket. Looks like we can merge this soon 👀 |
Known bugs that resulted in reopening
May likely fix
Wallet Connect Infura errors: Wallet connect - infura error in console #2093Wallet Connect not working on Gnosis Chain: WC doesn't work on GChain ( connect an owner via WC) #3372What it solves
The removal of an unnecessary interval and, in turn, numerous requests. Also, a reduction of ENS errors in the console.
How this PR fixes it
In researching how to reduce ENS console errors from our provider watcher, it became apparent that we were relying on a legacy method of 'watching' the Onboard provider. Onboard, however, has built-in subscriptions that are a better alternative than the interval we were using. (One of which resolves ENS domains on wallet connection).
Instead of using an interval that polls every few seconds, this PR migrates to using the
wallet
,address
,network
andens
subscriptions from ENS, responsible for:The legacy watcher interval has been removed, as well as the associated reducer/middleware adjusted. The reducer handles the subscriptions based on updates instead and wallet disconnection is now handled internally via Onboard, removing reliance on a provider removal method. Logic that was previously required in the middleware: instantiating contracts and saving the current provider for re-connection is now also handled by Onboard.
The notification system has been moved from provider 'fetching' (which was previously happening every time per interval) to the middleware, which is also subscription-based.
A few unnecessary utility functions have also be replaced or substituted for their Onboard counterparts.
How to test it
Nothing should change on a UI/UX level. Connection may seem a bit quicker. Areas to check are the following (cross-wallet):
providers
store data correctly, i.e. EOA details, ENS domain, hardware/smart contract wallet flags, etc.providers
store.