-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix: No recovery codes in 2FA page #44635
Conversation
Merge main to fix branch
Merge main to fixing branch
…back navigation after validating account
Merge main to fixing branch.
Merge main to fixing branch
Note: Video is added for only desktop web since there is navigation issue that I haven't fixed yet. |
Error to fix
Navigation.error.mp4Expected behaviour for navigation error
Expected.navigation.behaviour.mp4Note: After fixing the issue. I will remove the error component form BankAccountStep and use the new ValidateAccountMessage there |
@etCoderDysto I'm not sure what the issue is, but I think the screen for Lines 35 to 47 in 519d096
The screen for security and the 2FA page should be stacked together. SECURITY: {
ROOT: 'Settings_Security',
TWO_FACTOR_AUTH: 'Settings_TwoFactorAuth',
}, |
I got the same error #44635 (comment) after try fixing the screen stack. |
I found a documentation in navigation.md that talks about similar issue I am facing. I will try to understand what is casuing the issue.
The full explanation starts here |
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.
Looks good to me! Just had one issue to fixed.
return; | ||
} | ||
Session.toggleTwoFactorAuth(true); | ||
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps -- We want to run this when component mounts | ||
}, []); | ||
}, [isUserValidated]); |
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.
I think it's expected to be called on component mount. Also, I got this issue that the code is not show after refreshing the page.
Screen.Recording.2024-08-12.at.21.04.12.mp4
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.
It works fine when you refresh the page if you set USE_REACT_STRICT_MODE:false
in CONFIG.ts
. I added isUserValidated
to run the useEffect when the user returns back from validating their account. If the dependency is not added it will fail to run the useEffect.
The result when I add isUserValidated
dependency
isvalidated.mp4
The result when I don't add isUserValidated
dependency
Screen.Recording.2024-08-13.at.1.08.49.in.the.afternoon.mp4
Reviewer Checklist
Screenshots/VideosAndroid: Native44635.Android.1.mp444635.Android.2.mp4Android: mWeb Chrome44635.mWeb-Chrome.1.mp444635.mWeb-Chrome.2.mp4iOS: Native44635.iOS.1.mov44635.iOS.2.moviOS: mWeb Safari44635.mWeb-Safari.1.mov44635.mWeb-Safari.2.movMacOS: Chrome / Safari44635.Web.1.mp444635.Web.2.mp4MacOS: Desktop44635.Desktop.1.mp444635.Desktop.2.mp4 |
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 👍
@etCoderDysto Great job on this! ❤️ I just have a quick question about the |
Thanks @techievivek 🙇🏻♂️. It doesn't rigger a backend request. The request is triggered only when the user clicks |
@etCoderDysto Ok, thanks for confirming. I think we can improve this, as it might be confusing for users who expect a magic code email to arrive in their inbox when we navigate them to that page. Could we call the backend to schedule a magic code email before navigating them to the page? CC @mollfpr @trjExpensify, do you have any thoughts on this? |
+1! But I'm unsure if this is on purpose. |
@techievivek I thin we can do that. If we have to do that, I believe we should also make the same change to 'Contact methods' page to make the behaviour consistent across pages. Currently, we are not making BE request when a user navigates from contact methods page to Contact methods details page. Screen.Recording.2024-08-16.at.11.39.02.in.the.morning.mov |
Yes, that makes sense. I'm on mobile, but I think someone tried to fix this recently with contact methods and we had to revert it because whatever solution was used triggered two API calls. I think that might be because when adding. a secondary login we automatically send an email to verify the login - so it doesn't need a second one sent when navigating to the page. Would be good to check and test that (sorry I can't find it on mobile, and I'm OOO until end of next week). |
Yeah, I tested this out and can confirm that we automatically send an email to verify the login when a user adds a new secondary login so for the above case we don't need an another magic email when we navigate the user to the page. |
After revisiting this, I realized that sending a magic code email every time a user clicks on the |
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.
Thanks for fixing this up.
✋ 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/techievivek in version: 9.0.23-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.0.23-0 🚀
|
Details
Fixed Issues
$ #43603
PROPOSAL: #43603 (comment)
Tests
Two Factor Auth Page
Unvalidated account:
Unvalidated account > validate your account in Contact methods:
Unvalidated account > Sign out scenario:
Connect To BankAccount Page
Verify that you don't see validate your account first message
Verify that no errors appear in the JS console
Offline tests
N/A
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Security
Security.android.mp4
Bank
Bank.android.mp4
Android: mWeb Chrome
Security
security.android.chrome.mp4
Bank
chrome.android.bank.mp4
iOS: Native
Security
Security.ios.mp4
Bank
bank.ios.mp4
iOS: mWeb Safari
Security
Security.safari.mp4
Bank
bank.safari.mp4
MacOS: Chrome / Safari
Security
Web.security.mp4
Bank
Web.Bank.account.mp4
MacOS: Desktop
Security
Desktop.security.mp4
Bank
Desktop.Bank.account.mp4