-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[CP Staging] feat: Improve KYC error handling #30103
Conversation
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
@allroundexperts code looks good but I notice that if the user is on the TermsStep, clicks Enable Payments and the isPendingOnfidoResult
prop is sent as true from the AcceptWalletTerms API command, the user is not redirected to the Wallet page. If I manually navigate to /enable-payments
then the user is redirected as expected:
Screen.Recording.2023-10-22.at.2.04.54.PM.mov
Am I missing something?
@allroundexperts Not super sure if that's the issue. I've spun up the ngrok URL again. |
@MariaHCD Fixed! |
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.
LGTM
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-22.at.8.54.52.PM.movScreen.Recording.2023-10-22.at.8.54.12.PM.movScreen.Recording.2023-10-22.at.8.59.58.PM.movMobile Web - ChromeScreen.Recording.2023-10-22.at.9.35.26.PM.movMobile Web - SafariScreen.Recording.2023-10-22.at.9.38.48.PM.movDesktopScreen.Recording.2023-10-22.at.9.39.20.PM.moviOSScreen.Recording.2023-10-22.at.9.41.24.PM.movAndroidScreen.Recording.2023-10-22.at.9.50.41.PM.mov |
One more thing I noticed, @allroundexperts, if KYC is successful, we don't show the activation success page anymore. Is there a way to show the success page? I believe we're optimistically setting isPendingOnfidoResult to true so that's why? Screen.Recording.2023-10-22.at.9.29.04.PM.mov |
Yes. That's correct. I can make it so that it gets set by the backend response only. Does that work? |
@allroundexperts That would be better, I think! 👍🏼 |
Handled @MariaHCD! |
Nice, thanks, looks better! The only thing is nothing looks to be happening in the UI when the ActivateWallet API command is processing so it looks like the page is stuck for a few seconds: Screen.Recording.2023-10-22.at.9.47.51.PM.mov |
Does disabling the button work? |
Yes, I think it would! Do buttons have some sort of loading state, perhaps? |
@MariaHCD Handled. Can you please test now? |
Nice, looks good! Screen.Recording.2023-10-22.at.10.01.47.PM.mov |
So I've tested the following scenarios:
Can't think of any other scenario at the moment. In the other issue, we'll handle the case when we receive the successful or unsuccessful Onfido result asynchronously. In the case of success, the isPendingOnfidoResult will be removed from the userWallet. In case of failure, we'll have a different UI / error message. |
I am inclined to merge this for now so we can get this deployed. @Expensify/design if you have any suggestions on the UI here, we can fix them in a follow up PR 🙏🏼 |
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.
Small changes, @allroundexperts 🙏🏼
@@ -12,4 +12,7 @@ export default PropTypes.shape({ | |||
|
|||
/** When the user accepts the Wallet's terms in order to pay an IOU, this is the ID of the chatReport the IOU is linked to */ | |||
chatReportID: PropTypes.string, | |||
|
|||
/** Boolean to indicate whether the submission of wallet terms is being processed */ | |||
submitting: PropTypes.bool, |
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.
Very small change, but I think we should call this isLoading
to follow our naming patterns for bool props
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.
Handled.
@@ -66,6 +68,8 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen | |||
const hasAssignedCard = !_.isEmpty(cardList); | |||
const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; | |||
|
|||
const {isPendingOnfidoResult} = userWallet; |
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.
Just confirming, if isPendingOnfidoResult
doesn't exist in the userWallet, then it will be undefined so do we prefer lodashGet in these cases?
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.
Handled!
src/types/onyx/UserWallet.ts
Outdated
@@ -25,8 +25,8 @@ type UserWallet = { | |||
/** The user's wallet tier */ | |||
tier?: number; | |||
|
|||
/** Whether we should show the ActivateStep success view after the user finished the KYC flow */ | |||
shouldShowWalletActivationSuccess?: boolean; | |||
/** Whether the kyc is pending and is yet to be confirmed */ |
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.
/** Whether the kyc is pending and is yet to be confirmed */ | |
/** Whether the Onfido result is pending. KYC is not complete and the wallet will not be activated until we have the Onfido verification result */ |
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.
Handled.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
feat: Improve KYC error handling (cherry picked from commit e780e70)
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 1.3.88-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.88-11 🚀
|
Details
#30088
Fixed Issues
$ #30088
PROPOSAL: N/A
Tests
Steps for internal engineers:
Offline tests
N/A
QA Steps
No QA, will fully tested after https://github.com/Expensify/Web-Expensify/pull/39342
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop