[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] |
MariaHCD
left a comment
There was a problem hiding this comment.
@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! |
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 🙏🏼 |
MariaHCD
left a comment
There was a problem hiding this comment.
Small changes, @allroundexperts 🙏🏼
| 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.
Very small change, but I think we should call this isLoading to follow our naming patterns for bool props
| const hasAssignedCard = !_.isEmpty(cardList); | ||
| const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; | ||
|
|
||
| const {isPendingOnfidoResult} = userWallet; |
There was a problem hiding this comment.
Just confirming, if isPendingOnfidoResult doesn't exist in the userWallet, then it will be undefined so do we prefer lodashGet in these cases?
|
|
||
| /** 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.
| /** 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 */ |
|
✋ 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop