-
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
[$250] Validate account - When validate page is opened twice, code error auto disappears #54046
Comments
Triggered auto assignment to @mallenexpensify ( |
Edited by proposal-police: This proposal was edited at 2024-12-12 19:03:28 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Validate account - When validate page is opened twice, code error auto disappears What is the root cause of that problem?When the modal is open the first time the hasMagicCodeBeenSent will become true and when we open it for the second time b/c hasMagicCodeBeenSent is already true this effect will early return and App/src/components/ValidateCodeActionModal/index.tsx Lines 46 to 51 in 50c1db8
so the effect will run after the user inputs the code b/c now hasMagicCodeBeenSent will be false and firstRenderRef will not prevent the effect b/c it hasn't been set to true on initial render b/c hasMagicCodeBeenSent was set to true by the first opening of the modal What changes do you think we should make in order to solve the problem?We only want to run the effect to
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?we can make a test for What alternative solutions did you explore? (Optional)We can also remove And on another note the current use of firstRenderRef will not allow sendValidateCode whenever the modal is visible because the ref is only reset on render and it doesn't re-render on isVisible change so for some use cases like in NewContactMethodPage where we display the validate modal on press of a button we might want to request code whenever modal is visible. In that case, we can avoid using a ref and only rely on isVisible and hasMagicCodeBeenSent to sendValidateCode |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
It will set the
Because the 4th param,
will be
again. Now
App/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx Line 151 in 4f76f84
in the
App/src/components/MagicCodeInput.tsx Lines 160 to 165 in 4f76f84
it calls: App/src/components/MagicCodeInput.tsx Line 164 in 4f76f84
which calls App/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx Line 183 in 4f76f84
What changes do you think we should make in order to solve the problem?
App/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx Line 151 in 4f76f84
in this case. We already clear the input once we resend the validate code here: App/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx Line 170 in 4f76f84
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional)Alternative solution 1:
I removed the
Alternative solution 2:
to
|
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989 |
I was able to reproduce this. |
Screen.Recording.2024-12-14.at.5.27.53.AM.movThe steps are same as in the OP. |
Job added to Upwork: https://www.upwork.com/jobs/~021867737514319581525 |
Current assignee @allroundexperts is eligible for the External assigner, not assigning anyone new. |
Assigned @allroundexperts (note to self... I added 'Needs Reproduction' as a holder before adding to project. I forgot it auto-posted to #contributor-plus. This shouldn't be considered best practice because we (likely?) want to avoid BZ's NOT attempting reproduction. Need to think about more) |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.75-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Incorrect code error and the code will not auto disappear
Actual Result:
Incorrect code error and the code appear very briefly and then auto disappears
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6692456_1734022590911.20241213_005134.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @The text was updated successfully, but these errors were encountered: