Bugfix/deeplink, request modals and wallet connect#1877
Bugfix/deeplink, request modals and wallet connect#1877estebanmino merged 69 commits intodevelopfrom
Conversation
This reverts commit 3f7820d.
ibrahimtaveras00
left a comment
There was a problem hiding this comment.
Android doesn't progress pass splash screen
iOS I'm unable to get any deeplinks to work
built with METAMASK_ENVIRONMENT='production' yarn build:ios:release and detox build -c android.emu.release && detox test -c android.emu.release
rickycodes
left a comment
There was a problem hiding this comment.
left a few comments/question. admittedly, I need to brush up on react hooks... most of where we used them previously i was able to understand, but there's a lot of changes here. I may need to take another look at this tomorrow with a fresh set of eyes.
app/core/WalletConnect.js
Outdated
| this.redirectIfNeeded(); | ||
| } | ||
| // Clean call ids | ||
| tempCallIds = []; |
There was a problem hiding this comment.
instead of reassigning we could make tempCallIds a const and then empty it by setting length property to zero
const arr = ["foo","bar"]
undefined
arr
Array [ "foo", "bar" ]
arr.length
2
arr.length = 0
0
arr
Array []
| const waitForKeychainUnlocked = async () => { | ||
| let i = 0; | ||
| const { KeyringController } = Engine.context; | ||
| while (!KeyringController.isUnlocked()) { |
There was a problem hiding this comment.
does the KeyringController not have an unlock event we can listen for? checking every second for a whole minute seems not ideal 🤔
i see on the extension KeyringController extends EventEmitter which seems like a better pattern.
There was a problem hiding this comment.
we don't have that on controllers KeyringController
| transactionMeta.transaction.gasPrice = hexToBN(gasPrice); | ||
|
|
||
| if ( | ||
| (value === '0x0' || !value) && |
There was a problem hiding this comment.
rather than doing all the magic directly in an if condition what if instead we outline what the constraints are separately? I think that will make things a bit easier to understand.
something like:
const valueIsEmpty = value === '0x0' || !value;
const dataIsNotEmpty = data && data !== '0x';
...
if (valueIsEmpty && dataIsNotEmpty && ...)There was a problem hiding this comment.
this is payment channel stuff which we're deprecating, I think we shouldn't spend time on this (in fact I was deleting it acd5d43)
| if ( | ||
| props.paymentChannelsEnabled && | ||
| AppConstants.CONNEXT.SUPPORTED_NETWORKS.includes(props.providerType) && | ||
| transactionMeta.transaction.data && |
There was a problem hiding this comment.
does transactionMeta always have a transaction key? what happens if it doesn't? you could use optional chaining here to be safe
There was a problem hiding this comment.
payment channel stuff
| }, 1000); | ||
| }); | ||
| const initForceReload = () => { | ||
| // Force unmount the webview to avoid caching problems |
There was a problem hiding this comment.
Why do we have to do this?
There was a problem hiding this comment.
is to mount MainNavigator on language change
|
After retesting, here are the following issues: Issue 1: Android still isn't moving past the splash screen Issue 2: I'm unable to open deeplinks/Wallet Connect when the app is either in the background and locked, or completely in a killed state also too, as a side note, I'm in a broken state when I attempt to do this, seen here = http://recordit.co/Flpx8M1fyG This currently works on iOS build 525 seen here = http://recordit.co/67bKuGHqLF Issue 3: When you are going via Wallet connect (in this scenario I had uniswap.exchange open on Safari and came to MM via wallet connect), it shows the wrong title URL on the approve modal. Furthermore, when I kill the app and relaunch, I'm no longer able to see the ERC-20 token I want to swap to; seen here = https://recordit.co/zPi5Z8hxOo You can also follow this thread for more information |
There was a problem hiding this comment.
All issues have been resolved on Android
With iOS, the only outstanding issue is that in a killed, or locked state deeplinks will not work on a device that has biometrics enabled (FaceID or TouchID)
similar to #1798
ibrahimtaveras00
left a comment
There was a problem hiding this comment.
Only 1 scenario fails on both OS's:
When you have the app in a locked state and you're not on the wallet view
ios = http://recordit.co/8sEuCj1qyp
Android = https://recordit.co/LnIdgLJavd
This nonetheless works if you have a device without biometrics and use your password to log in
ibrahimtaveras00
left a comment
There was a problem hiding this comment.
Wallet connect is now fixed on both OS's 👍
However, there are now 2 places of failure on both OS's
- Payment request isn’t working when app is in a locked state (set to immediately)
Seen here = http://recordit.co/uyQfcwuGXF
As you can see it opens to the correct view then immediately closes the view
- Scanning a public address is not working as it should
Ever since #1859 when a user scans a public address QR code, they should be sent to the send to view
Seen here = http://recordit.co/JmRNIYrhl8
ibrahimtaveras00
left a comment
There was a problem hiding this comment.
fixes look good on both OS's, QA Passed 👍
* hooksentry * handleappsyayedeeplinkmanager * branch * rm payment channel stuff * Revert "rm payment channel stuff" This reverts commit 3f7820d. * remove payment channel stuff * works * update * init once and bump wc| * wc temp call ids * waitForKeychainUnlocked * paymentchannelstuff * snaps * tempcallids * build * :527 * android * bumpandfixes * CURRENT_PROJECT_VERSION * circleci * pod * resource_class * bump * builds * bump * dl manager to main * unlock * unlock * snaps * pass to root * fix titlw * finally * 534 * lockout * scan * android * test * finally * bump * snaps * lock * browser * goToNewTab * passdeeplink to main| * 538 * fix * 539 * locked * 541 * bump * 542 * fixaddress * drwaer * 543 * fix * 544 * fix * a * test



Description
This PR includes
refactor of the
EntryandMaincomponents to hooks. The problem with these component was the state handling, it was messy so we were having problems with all the modals onMain.WalletConnect version update and added a way to handle wallet connect requests when the app is locked.
Deeplinks are being erased if the app is closed, to not get the request when the app is opened again without context.
Checklist
Issue
Resolves #1798
Resolves #1804