Fix: Expensify card - Error when wrong 4 digit is used persists for a few sec after a refresh#52303
Conversation
… few sec after a refresh
|
Hi @alitoshmatov The error is still briefly displayed (but shorter then before, < 1 sec) on mweb android and ios using my proposed solution, even if i change expensify-app-fork-README-md-at-main-.-margelo-expensify-app-fork.online-video-cutter.com.1.mp4Can we implement 'beforeunload' event listener instead? It works in mweb New-Expensify.34.mp4 |
|
@nyomanjyotisa I don't think that is a good idea. I think we rushed on choosing a solution, we have similar cases on signup and 2FA pages, can we check them and see what was their solution for the same issue |
|
@alitoshmatov for the signup and 2fa, we use Line 34 in b1c1a4b Line 1399 in b1c1a4b I think for this expensify card case we can't do the same as above, since the error message is under specific cardID |
|
@alitoshmatov another approach: Only allow to show error message after user click submit button |
|
@alitoshmatov 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] |
@nyomanjyotisa This changes existing behavior not viable option |
|
@alitoshmatov I think it is expected not to showing any errors before submit action |
|
But when there is an error and you input valid answer error should be dismissed automatically. I think we should close this PR, and go back to the issue to choose a new proposal |
It doesn't change this behavior actually if there is no error on
|
|
You are right, I didn't see this part where errors are cleared everytime there is an input App/src/pages/settings/Wallet/ActivatePhysicalCardPage.tsx Lines 94 to 102 in b1c1a4b |
|
@cristipaval We had an issue with original solution, so we decided to go with this new solution. What do you think? |
fine for me |
|
PR and recordings are updated and ready for review 👍 |
| const [formError, setFormError] = useState(''); | ||
| const [lastFourDigits, setLastFourDigits] = useState(''); | ||
| const [lastPressedDigit, setLastPressedDigit] = useState(''); | ||
| const [shouldAllowToShowError, setShouldAllowToShowError] = useState<boolean>(false); |
There was a problem hiding this comment.
Very confusing, I think canShowError is more suitable.
|
Please update all recordings |
|
Sure, I've updated it as requested @alitoshmatov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chromecode-mweb.mp4iOS: NativeiOS: mWeb Safaricode-safari.mp4MacOS: Chrome / Safaricode-web.movMacOS: Desktopcode-desktop.mov |
|
@nyomanjyotisa could you please resolve the conflicts? |
|
Conflict resolved @cristipaval |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.0.72-0 🚀
|
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.0.72-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.72-1 🚀
|

Explanation of Change
Fixed Issues
$ #51396
PROPOSAL: #51396 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Pre-conditions:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Unable to test on native Android since the page cannot be refreshed/reloaded
Android: mWeb Chrome
Android-mWeb.Chrome.mp4
iOS: Native
Unable to test on native iOS since the page cannot be refreshed/reloaded
iOS: mWeb Safari
iOS-mWeb.Safari.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4
MacOS: Desktop
MacOS-Desktop.mp4