Skip to content

Bugfix/deeplink, request modals and wallet connect#1877

Merged
estebanmino merged 69 commits intodevelopfrom
bugfix/deeplink-modals
Nov 5, 2020
Merged

Bugfix/deeplink, request modals and wallet connect#1877
estebanmino merged 69 commits intodevelopfrom
bugfix/deeplink-modals

Conversation

@estebanmino
Copy link
Copy Markdown
Contributor

@estebanmino estebanmino commented Oct 7, 2020

Description

This PR includes

  1. refactor of the Entry and Main components to hooks. The problem with these component was the state handling, it was messy so we were having problems with all the modals on Main.

  2. WalletConnect version update and added a way to handle wallet connect requests when the app is locked.

  3. Deeplinks are being erased if the app is closed, to not get the request when the app is opened again without context.

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

Issue

Resolves #1798
Resolves #1804

@estebanmino estebanmino requested a review from a team as a code owner October 7, 2020 00:08
@ibrahimtaveras00 ibrahimtaveras00 added needs-qa Any New Features that needs a full manual QA prior to being added to a release. QA in Progress QA has started on the feature. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Oct 7, 2020
Copy link
Copy Markdown
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ibrahimtaveras00 ibrahimtaveras00 added QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed QA in Progress QA has started on the feature. labels Oct 7, 2020
Copy link
Copy Markdown
Contributor

@rickycodes rickycodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

this.redirectIfNeeded();
}
// Clean call ids
tempCallIds = [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have that on controllers KeyringController

transactionMeta.transaction.gasPrice = hexToBN(gasPrice);

if (
(value === '0x0' || !value) &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 && ...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does transactionMeta always have a transaction key? what happens if it doesn't? you could use optional chaining here to be safe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

payment channel stuff

}, 1000);
});
const initForceReload = () => {
// Force unmount the webview to avoid caching problems
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have to do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is to mount MainNavigator on language change

@ibrahimtaveras00
Copy link
Copy Markdown
Contributor

ibrahimtaveras00 commented Oct 9, 2020

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
the app stays with a white loading screen on wallet, and none of my account information is displayed

Screen Shot 2020-10-08 at 8 08 37 PM

Screen Shot 2020-10-08 at 8 08 51 PM

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

Screen Shot 2020-10-08 at 8 19 44 PM

You can also follow this thread for more information

Copy link
Copy Markdown
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@estebanmino estebanmino added needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Nov 2, 2020
Copy link
Copy Markdown
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ibrahimtaveras00 added QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Nov 2, 2020
Copy link
Copy Markdown
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wallet connect is now fixed on both OS's 👍

However, there are now 2 places of failure on both OS's

  1. 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

  1. 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

Copy link
Copy Markdown
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes look good on both OS's, QA Passed 👍

@ibrahimtaveras00 ibrahimtaveras00 added QA Passed QA testing has been completed and passed and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Nov 5, 2020
@estebanmino estebanmino merged commit f3a066e into develop Nov 5, 2020
@estebanmino estebanmino deleted the bugfix/deeplink-modals branch November 5, 2020 00:27
rickycodes pushed a commit that referenced this pull request Jan 31, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next release QA Passed QA testing has been completed and passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Links are lost when unlocking Connect prompt not shown after unlock

5 participants