-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Recovery code input fix #36774
Recovery code input fix #36774
Conversation
Hi @getusha! Regarding trimming VideoiOS: Screen.Recording.2024-02-19.at.5.41.57.AM.movAndroid: Screen.Recording.2024-02-19.at.3.15.24.AM.movThe root cause seems to be upstream, and since this behavior didn't exist before I'm concerned it might be reported as a regression This behavior could be a bit disorienting (and feels like something is not working) for other devices. I've updated logic to trim input when submitting, over restricting user action. Please let me know your thoughts! |
diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js b/
src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
index 4afba77b77..d6d3569354 100755
--- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
+++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
@@ -179,7 +179,7 @@ function BaseValidateCodeForm(props) {
setInput = setRecoveryCode;
setInput = setRecoveryCode;
diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
index 4afba77b77..d6d3569354 100755
--- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
+++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
@@ -179,7 +179,7 @@ function BaseValidateCodeForm(props) {
setInput = setRecoveryCode;
}
- setInput(text);
+ setInput(text.trim().slice(0, CONST.RECOVERY_CODE_LENGTH));
setFormError((prevError) => ({...prevError, [key]: ''})); what do you think about this change? |
@neonbhai any updates? also looks like we've got a conflict |
@neonbhai bump |
Hi, trimming before |
@getusha I've added some changes, please take a look We will not be able to have VideoScreen.Recording.2024-03-01.at.9.05.12.AM.mov
We can either:
I'm leaning towards 1 since we do allow space on latest main. Let me know your thoughts! |
@neonbhai i don't understand, are we talking about a different kind of issue? i am not suggesting to use |
That makes sense, I apologize I misunderstood. Slicing the input here would give us this behavior: VideoScreen.Recording.2024-03-04.at.2.40.10.AM.movThis seems inconsistent with other form inputs behaviors where additional characters are ignored after limit. To fixWe can add a check like this before setting input here if(recoveryCode.length === CONST.RECOVERY_CODE_LENGTH) {
return;
} Resulting behavior: VideoScreen.Recording.2024-03-04.at.3.49.58.AM.movThe cursor would move to the end, when trying to edit, but I guess that will be okay? cc: @getusha |
thanks @neonbhai for the detailed explanation looks like |
@getusha ready for review! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-13.at.10.39.14.at.night.movAndroid: mWeb ChromeScreen.Recording.2024-03-13.at.1.27.20.in.the.afternoon.moviOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-13.at.22.07.06.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-13.at.22.00.07.mp4MacOS: Chrome / SafariScreen.Recording.2024-03-13.at.1.14.57.in.the.afternoon.movMacOS: DesktopScreen.Recording.2024-03-13.at.10.10.50.at.night.mov |
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.4.53-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.53-2 🚀
|
Details
Fixed Issues
$ #35947
PROPOSAL: #35947 (comment)
Tests
Precondition:
User should have 2-FA enabled
Offline tests
Cannot login when offline
QA Steps
Same as Tests step
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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 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
android.mov
Android: mWeb Chrome
mweb.mov
iOS: Native
ios.native.mov
iOS: mWeb Safari
mweb.safari.mov
MacOS: Chrome / Safari
819ed13c-2602-4435-81ba-4df3f7d13e00.mp4
MacOS: Desktop
desktop.screencast.mov