Open lanitochka17 opened 1 month ago
Triggered auto assignment to @muttmuure (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
We think that this bug might be related to #vip-vsp
@muttmuure FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Two-factor authentication step 1 appears briefly when open 2FA option if it is enabled
We use a useState
to assign the current step (success/enabled/disabled) for two factor auth, the initial value set for this is CONST.TWO_FACTOR_AUTH_STEPS.CODES
.
We also use a useEffect
to determine the value of this step.
But for the very first time, the default value will be set to CONST.TWO_FACTOR_AUTH_STEPS.CODES
and then the useEffect
would run to determine the actual step.
But now as the default value was codes
step, this case would be set to true and we would see the step 1 briefly and then the useEffect
would set the correct step
.
This is the root cause
We should set the default value to null
and let the useEffect fetch the correct step for us.
The 2FA page shows the code page briefly when opening it.
The initial value/state of the current step to render is the codes page. https://github.com/Expensify/App/blob/75c104bfe009ef937bcd129a35bb5a2e52f4339d/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.tsx#L26
Then, we have this useEffect
which will get the correct step.
https://github.com/Expensify/App/blob/75c104bfe009ef937bcd129a35bb5a2e52f4339d/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.tsx#L32-L43
Instead of using both useState and useEffect, we can use useMemo.
const currentStep = useMemo(() => {
if (account?.twoFactorAuthStep) {
return account.twoFactorAuthStep;
}
return account?.requiresTwoFactorAuth ? CONST.TWO_FACTOR_AUTH_STEPS.ENABLED : CONST.TWO_FACTOR_AUTH_STEPS.CODES;
}, [account?.requiresTwoFactorAuth, account?.twoFactorAuthStep]);
Then, we can remove the setCurrentStep from handleSetStep because TwoFactorAuthActions.setTwoFactorAuthStep will update the current step which will trigger the memo above. https://github.com/Expensify/App/blob/75c104bfe009ef937bcd129a35bb5a2e52f4339d/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthSteps.tsx#L45-L49
Not overdue
@muttmuure Huh... This is 4 days overdue. Who can take care of this?
Job added to Upwork: https://www.upwork.com/jobs/~015c346b94975326f0
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External
)
@bernhardoj's proposal looks good!
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
PR is ready
cc: @thesahindia
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.5-13 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-07-17. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
I'll request in ND once payment is due.
It was implemented like this in the beginning then the code was changed but it got reverted by https://github.com/Expensify/App/pull/31738 because of regressions so there's no specific PR responsible for this.
We don't have to add a test case for this but if we want here are the steps:-
Prerequisite: 2FA enabled
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.6-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-07-22. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
Payment should be due tomorrow (07-17)
Requested in ND.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.84-0 Reproducible in staging?: Y Reproducible in production?: 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): ponikarchuks+315324@gmail.com Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Two-factor authentication enabled page open
Actual Result:
2FA step 1 appears briefly then Two-factor authentication enabled page open
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/99148d5f-dbbd-4ce9-981a-c436020f83dd
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @muttmuure