-
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
[HOLD for payment 2023-04-28] [$1000] App displays phone number in result for brief moment even for invalid numbers (Bad UX) #17200
Comments
Triggered auto assignment to @MitchExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Whats odd is that there is an account tied to an "invalid" number that exists ("+11111111111111"), so I guess the question is if we should show the "Please enter a valid phone number.." message at all when an account that matches the search exists. Also, what valid phone number is 14 digits long? Seems weird to me |
Either way, it seems we've defined anything over 14 digits as "invalid" and this behaviour is weird so should be fixed |
Job added to Upwork: https://www.upwork.com/jobs/~01bee86ec37b82125e |
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Triggered auto assignment to @chiragsalian ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.App displays phone number in result for brief moment even for invalid numbers (Bad UX) What is the root cause of that problem?When user type something it will trigger Line 185 in 3abe7b2
Within Lines 79 to 81 in 3abe7b2
Line 58 in 3abe7b2
Debounce is eventually calling Lines 126 to 142 in 3abe7b2
During every render header message and sections data generated via this code: Lines 166 to 171 in 3abe7b2
So here it will trigger multiple render and due to that, it will show Phone number in result for a moment and disappear thereafter. This is the root cause of the problem. What changes do you think we should make in order to solve the problem?Here we can see that within So here we are not calling any backend api to generate search result, but passing value from props and state to So we can remove debounce as shown in code below. //this.debouncedUpdateOptions = _.debounce(this.updateOptions.bind(this), 75); // *** Old Code
this.updateOptions = this.updateOptions.bind(this); // *** Updated Code
onChangeText(searchValue = '') {
// this.setState({searchValue}, this.debouncedUpdateOptions); // *** Old Code
this.setState({searchValue}, this.updateOptions); // *** Updated Code
} What alternative solutions did you explore? (Optional)None Results17200-SearchUi.mov |
ProposalPlease re-state the problem that we are trying to solve in this issue.App displays invalid phone number error but also displays phone number in result for 1-2 seconds before removing it What is the root cause of that problem?The root cause is here Line 58 in cdcb335
updateOptions , so 75ms after the user enters the input, we'll update the result list.
Debouncing is a good thing to prevent exessive re-rendering and was added on purpose here #3669. The actual problem is that we're delaying out input validation with the debounce. If we notice in the OP video it's clear that the header message What changes do you think we should make in order to solve the problem?We need to make sure input validation-related logic is extracted out of the debounce so that invalid input is highlighted immediately. The header message is already doing it correctly, so we should apply the same for the option list. As soon as the user type, if the input is invalid email/invalid phone, we should reset the options list immediately. This can be done by creating a function to wrap the phone and email validation logic in App/src/libs/OptionsListUtils.js Line 610 in cdcb335
And in Line 94 in 5eccf99
userToInvite will be null and can set it to null in the state without involving any debounce.
The overhead of the validation is minimal and will provide the UX improvement needed for this error validation case. What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.App displays phone number in result for brief moment even for invalid numbers (Bad UX) What is the root cause of that problem?We update What changes do you think we should make in order to solve the problem?We can also modify What alternative solutions did you explore? (Optional)Not Yet |
@PrashantMangukiya Thanks for the proposal. Debouncing was added to prevent unnecessary re-renders . Removing it will cause regressions , Please check this PR #3824 for more details. |
@tienifr Thanks for the proposal. Your proposal will add unnecessary overhead , It may affect performance as it validate inputs in real time, and it will validate input twice. |
@hellohublot, thank you for submitting the proposal. While I find your solution to be reasonable, I do not think your RCA appears to be correct. Instead of fixing the root cause, I believe it only hides the bug. My question is, why is the data inconsistent? As far as I know, |
@fedirjh we can extract the validation and reuse it between the |
@tienifr |
Thanks for your suggestion What I mean is that our I printed the But the value of So my proposal is to suggest that we update |
ProposalPlease re-state the problem that we are trying to solve in this issue.App displays phone number in result for brief moment even for invalid numbers (Bad UX) What is the root cause of that problem?The main reason is getting sections when we don't need them, because we shouldn't show sections when we have a validation message What changes do you think we should make in order to solve the problem?
we can pass an empty array of sections options when the header message property exists (meaning that if we have a validation message we shouldn't show sections), and when we pass sections of an empty array they disappear immediately. Demo video: Screen.Recording.2023-04-12.at.17.43.45.movWhat alternative solutions did you explore? (Optional)None |
📣 @arayiksuqiasyan! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Format:
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
That's right.
@hellohublot You're correct that the current value of |
thanks for the bump. Proposal LGTM. Feel free to create the PR @hellohublot |
📣 @hellohublot You have been assigned to this job by @chiragsalian! |
Note to myself that timeline bonus will apply here 🎉 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.3-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 2023-04-28. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
|
Looking for a buddy check on any required addition to test rail @isagoico, I thiiink our existing tests should catch this, do you agree? |
@MitchExpensify I don't think that our current tests would catch this atm BUT I also don't think this is a regular user behavior flow that would affect a big pool of customers. |
I love that idea @isagoico ! |
Great! We will test these on a monthly basis and post here if the same issue resurfaces. |
Nice! Just to be sure, should I create a regression test in that case @isagoico? @hellohublot mins applying to this Upwork job for payment? https://www.upwork.com/jobs/~01bee86ec37b82125e Thank you! |
Paid reporter & C+, just waiting on @hellohublot 😄 |
@MitchExpensify Thanks, I have submitted a proposal in upwork, the name and avatar are the same if you can't find me (I have encountered it before), you can send me an offer directly |
No need! This will be tested directly from the issue. No test steps or test cases are needed. |
@MitchExpensify Thanks, Accepted |
Great! Thanks everyone. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
App should display invalid phone number error and shouldn't display phone number in result
Actual Result:
App displays invalid phone number error but also displays phone number in result for 1-2 seconds before removing it
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.2.97-2
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):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
glitch.invalid.phone.number.search.mp4
Recording.176.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1680968836716639
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: