You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-03-25] [$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it #35947
Version Number: 1.4.37-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: Email or phone of affected tester (no customers):applausetester+0507gm@applause.expensifail.com Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Precondition:
User should have 2-FA enabled
1.Log in to staging.new.expensify.com
2. Enter email address from precondition
3. Navigate to email and locate the magic link - change to staging if needed
4. Open an new tab and navigate to the staging link
5. Verify the 2FA required page is displayed
6. Navigate back to the original tab
7. Click on "Use recovery code" to change to "Use 2 factor authentication code"
8. Enter authentication code with space at the beginning
9. Click Sign in
10. Error message will appear
11. Erase the space
12. Click Sign in
Expected Result:
Error should dismiss and user should successfully log in
Actual Result:
Error message reappears and user can not log in
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/-][+][$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/+]on Feb 6, 2024
What changes do you think we should make in order to solve the problem?
have a sanity check to remove all the whitespaces and pass clean value to validate. Also while sending data to the backend below, trim the input to remove whitespaces
This will help us revalidate our logic as if we remove the maxLength, then the user will be allowed to enter the value and push it for validation on the backend, we should not let it call to the BE and set the error there itself on the FE
Problem with removing maxLength
Here we will still send the whitespaces if we remove the maxLength and which will return an error, so trimming is still required
changed the title [-][$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/-][+][HOLD for payment 2024-03-25] [$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/+]on Mar 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.53-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@getusha] The PR that introduced the bug has been identified. Link to the PR:
[@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@getusha] Determine if we should create a regression test for this bug.
[@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
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:
[@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/a
[@getusha] Determine if we should create a regression test for this bug. No, seems like a very minor bug and i don't think we need we need a regression test for it.
[@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. N/a
Activity
melvin-bot commentedon Feb 6, 2024
Job added to Upwork: https://www.upwork.com/jobs/~018d55723e0e20585e
[-]Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/-][+][$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/+]melvin-bot commentedon Feb 6, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)melvin-bot commentedon Feb 6, 2024
Triggered auto assignment to @puneetlath (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.allgandalf commentedon Feb 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Authentication code value is not accepted when put Space and than correct it
What is the root cause of that problem?
We don't have sanity checks for the input value in the textbox
App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Lines 286 to 289 in 8563c0f
Also the max length of textbox is 8,
What changes do you think we should make in order to solve the problem?
have a sanity check to remove all the whitespaces and pass clean value to validate. Also while sending data to the backend below, trim the input to remove whitespaces
App/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Line 306 in 8563c0f
Update the
isValidRecoveryCodecheck to:and update the submit input code to:
Update the
RECOVERY_CODE_LENGTHto 10 for considering one extra space before and after the stringApp/src/CONST.ts
Line 934 in f6ba751
This will help us revalidate our logic as if we remove the
maxLength, then the user will be allowed to enter the value and push it for validation on the backend, we should not let it call to the BE and set the error there itself on the FEHere we will still send the whitespaces if we remove the
maxLengthand which will return an error, so trimming is still requiredApp/src/libs/ValidationUtils.ts
Lines 284 to 286 in f6ba751
muas19 commentedon Feb 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Authentication code value is not accepted when put Space and than correct it
What is the root cause of that problem?
The validation check in this file does not cater for spaces
App/src/libs/ValidationUtils.ts
Line 285 in 8563c0f
What changes do you think we should make in order to solve the problem?
We should update the REGEX pattern in the const file for spaces or trim it.
App/src/CONST.ts
Line 883 in 8563c0f
What alternative solutions did you explore? (Optional)
na
allgandalf commentedon Feb 6, 2024
Proposal updated
Only updated the Solution, no concept change only added code to support my solution
neonbhai commentedon Feb 6, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Authentication code value is not accepted when put Space and than correct it.
What is the root cause of that problem?
This happened as when pasting with space the last digit did not get pasted.
This is a UX bug as we do not expect the recovery code input to have a tight character limit (or trim silently when pasting).
It is also unclear that the recovery code limit is 8 (since it is not a standard number).
We should remove the
maxLengthprop hereWhat changes do you think we should make in order to solve the problem?
We will remove the
maxLengthprop from the Recovery Code Text Input hereAlternatively
We can set it to
FORM_CHARACTER_LIMIT, like we do for some form elementsgetusha commentedon Feb 7, 2024
@GandalfGwaihir's proposal Looks good to me, trimming the value makes sense.🎀 👀 🎀 C+ Reviewed!
31 remaining items
[-][$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/-][+][HOLD for payment 2024-03-25] [$500] Web - 2FA - Authentication code value is not accepted when put Space and than correct it[/+]melvin-bot commentedon Mar 18, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.53-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-03-25. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 18, 2024
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:
puneetlath commentedon Mar 22, 2024
@getusha friendly reminder about the checklist so that we can pay on Monday.
puneetlath commentedon Mar 25, 2024
@neonbhai has been paid. Still waiting on the checklist for @getusha
getusha commentedon Mar 25, 2024
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:
getusha commentedon Mar 25, 2024
@puneetlath apologies, I forgot about the checklist despite your reminder. 😄
puneetlath commentedon Mar 25, 2024
No worries! Thanks for taking care of it.
It looks like it didn't auto-offer you for some reason. Offer is here: https://www.upwork.com/nx/wm/offer/101569210
Please ping me on the issue when you've accepted
getusha commentedon Mar 25, 2024
@puneetlath accepted.
puneetlath commentedon Mar 25, 2024
All paid. Thanks everyone!