Closed kavimuru closed 1 year ago
Triggered auto assignment to @jliexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)On v99.4 (Mac) and can reproduce. Also occurs on Android (Pixel 3a, v98-2).
This is a minor bug, but I agree that the year field should mirror the rate field, as there aren't spaces in a year.
Job added to Upwork: https://www.upwork.com/jobs/~01ecf6260853d6f525
Triggered auto assignment to @trjExpensify (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External
)
In this issue, we can notice that the space character is allowed when searching for the year, which should not be allowed.
When filtering, we do not sanitize the input provided by the user and directly use whatever is provided. https://github.com/Expensify/App/blob/e8bc6a86f13fd2f5561de5e6251abffa8f890384/src/pages/YearPickerPage.js#L75
We should create a regex rule that sanitizes whatever is typed by the user. This can be as simple as /[\D]/g
, which will replace and remove anything that is not a digit from the user input. We can filter the results based on that.
Additionally, we can add some more constraints such as the maximum number of characters that the user can enter is 4.
Triggered auto assignment to @hayata-suenaga (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
The current implementation allows spaces in the year search field between the numeric digits, which is not consistent with other numeric fields in the app like Rate.
The filterYearList function in the YearPickerPage class does not filter out spaces from the input text, resulting in spaces being allowed in the year search field.
Modify the filterYearList function in the YearPickerPage
class to remove spaces from the input text before filtering the yearOptions
list. This can be achieved using the replace method with a regular expression \s/g
to remove all spaces from the input text. The filtered text should then be used for filtering the yearOptions list using the _.filter method. here
Eg.
filterYearList(text) {
// Remove spaces from the input text
const filteredText = text.replace(/\s/g, '');
this.setState({
inputText: filteredText,
yearOptions: _.filter(this.yearList, year => year.text.includes(filteredText)),
});
}
Hi @trjExpensify - I've had to reassign as I'm headed OOO for the next 2 weeks. I've verified that the bug occurs in Chrome and Android so you're good to go!
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
We are trimming the values when we are filtering the year data only the thing is we are not validating the user-typed number so for that we just need to make sure white space is replaced with the blank which is a simple regex to validate replace(/ /g, '')
we are already using in modifyRoomName()
, validating the debit card number , emoji utils
We dont need to add regex \s/g
(which is used to remove whitespace from a string (including spaces, tabs and newline characters ) simply because the user never gets a chance to add tabs and newline characters
I.e -> when the user press tab it changes focus and we are already limiting the value to 4 characters to the max and number of line is 1 so it doesn't make sense to add regex \s/g
Since we are filtering displayed value that we can also add to yearOptions
as well so need to remove text.trim()
filterYearList(text) {
+ const filteredText = text.replace(/ /g, '');
this.setState({
+ inputText: filteredText,
- yearOptions: _.filter(this.yearList, year => year.text.includes(text.trim())),
+ yearOptions: _.filter(this.yearList, year => year.text.includes(filteredText)),
});
}
Note
IMO we should not replace text with blank space ([\D]/g
its simply a bad UX behavior and also we never used it anywhere else in the app
We are already limiting the text character to a maximum of 4 so there is no need to add validation here
@s77rt
The current implementation allows spaces, and characters in the year text input of YearPickerPage. But it should only allow numeric characters
The keyboard type number-pad is not working as expected, because it should have only allowed numbers by default
Before modifying the state inside the filterYearList function input text should be formatted just like we're doing in rate input field mentioned in issue description
filterYearList(text) {
// Remove all non-numeric characters from the input
const inputYear = text.replace(/[^0-9]/g, '');
this.setState({
inputText: inputYear,
yearOptions: _.filter(this.yearList, year => year.text.includes(inputYear)),
});
}
📣 @gargmegham! 📣
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. Please follow these steps:
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
📣 @gargmegham! 📣
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. Please follow these steps:
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details Your Expensify account email: <REPLACE EMAIL HERE> Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: meghamgarg@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~0170461d5a03bcee8d
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@hayata-suenaga Please remove the Reviewing
label. No one is assigned yet.
@Prince-Mendiratta Thanks for the proposal. Your RCA is correct and the fix looks good to me :+1:.
:ribbon: :eyes: :ribbon: C+ reviewed
cc @hayata-suenaga
Thank you for your review, @s77rt!
Additionally, we can add some more constraints such as the maximum number of characters that the user can enter is 4.
What are your thoughts on additional constraints?
@aman-atg Thanks for the proposal. The RCA is correct but the suggested fix is a duplicate and I think we want to remove everything that is not a number and not just spaces.
@dhairyasenjaliya Thanks for the proposal. The RCA is correct but it's basically a copy-paste even if you agree with someone's RCA you should at least rephrase or give credit to the original writer. As for your concern about replacing other text, we do that already here.
Hm oky point noted was simple RCA thank you @s77rt
@gargmegham Thanks for the proposal. I don't think your RCA is exactly correct, the keyboard type is only for virtual keyboard which is working fine.
@Prince-Mendiratta
What are your thoughts on additional constraints?
The length is already limited to 4 here.
@hayata-suenaga before assigning @Prince-Mendiratta do you think this should be handled by @ArekChr as a part of https://github.com/Expensify/App/issues/14322? We had a discussion about this bug but we decided to ignore it at that time, I think mostly because we didn't really consider it as a bug and I was not really convinced about the way it was meant to be handled.
I think we should hire @Prince-Mendiratta here since the solution we were going with is slightly different.
Just stating the above for clarity and transparency. cc @ArekChr .
@s77rt thank you for the proposal review.
I think we can go with @Prince-Mendiratta. Assigning @Prince-Mendiratta
📣 @Prince-Mendiratta You have been assigned to this job by @hayata-suenaga! Please apply to this job in Upwork 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 📖
@trjExpensify, @s77rt, @Prince-Mendiratta, @hayata-suenaga Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue. PR deployed to staging 19 hours ago.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.2-5 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 2023-04-27. :confetti_ball:
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:
Hm, where's the checklist for this? Adding it manually..
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:
@trjExpensify I'm not too sure about Melvin's flow but maybe the BZ checklist was not triggered as I was not assigned in the PR?
Oh, maybe. I didn't think that had an impact tbh. Payments check in the meantime. I can see the PR was approved on the 13th, so within the timeframe, the slow down on merge was on our side.
Sound about right?
I don't think bonus applies here, this was merged on 18th.
I don't think bonus applies here, this was merged on 18th.
Yeah, I looked at that, but you were both done and approved on the 13th. After the weekend, the hold up was on us internally to action on the merge. Do you think I'm missing something?
Regression Test Proposal
@trjExpensify, @hayata-suenaga did request a change on April 13th so technically it was not 100% ready for merge on April 13th.
To help with the timeline analysis,
🐛 Issue created at: Tue, 11 Apr 2023 18:20:13 GMT 🧯 Help Wanted at: Wed, 12 Apr 2023 03:31:33 GMT 🕵🏻 Contributor assigned at: Wed, 12 Apr 2023 17:31:52 GMT 🛸 PR created at: Wed, 12 Apr 2023 18:43:00 GMT ✅ C+ Approved at: Thu, 13 Apr 2023 09:21:51 GMT ❗ Changes requested by @hayata-suenaga: Thu, 13 Apr 2023 15:26:39 GMT ✅ Requested changes applied at: Thu, 13 Apr 2023 18:52:34 GMT 🎯 PR merged at: Tue, 18 Apr 2023 18:30:19 GMT ⌛ Business Days Elapsed between assignment and PR merge: 5
I'll leave the decision up to you guys!
Yeah, because the changes were still applied within the timeframe and no further changes were required after that, the delay from the 13th onwards were on us I think.
Okay offers have been sent.
Settled up!
@s77rt re: the regression test, there's this one here in TestRail. Instead of a totally separate one wouldn't we just add to that test script for ease?
Maybe..
@tjferriss I feel the test won't fit well with those since this one requires attention to the year selection page which none of existing tests mention.
Actually I think we can skip the regression test for this one just to be consist with the types of regression tests on that page.
The offending PR has been commented on: I don't think this applies here since it's not a regression. cc @hayata-suenaga
I agree
this is on hold for payment
this is on hold for payment
Payment has been made, we're just looking at this regression test.
I feel the test won't fit well with those since this one requires attention to the year selection page which none of existing tests mention.
Ah, wait. The test script has changed since I linked it - likely because it has been recently developed. Okay, so there's this standalone test for DOB now.
So what we could do is insert these two lines before 5 & 6 perhaps?
@trjExpensify Yes that looks good to me, but step 6 is to verify that the non of the typed characters got inserted (there is no error message)
Oh, so if it's not possible at all to enter them at all (i.e it's a numerical keyboard) then what are we testing for? 😕
Sorry, I interpreted this suggested script as being that these characters are allowed for the input but receive an error on blur (a bit like forms). I just checked this and it's a numerical keyboard, so I think we can forgo this addition to the script - it's extraneous.
Going to close this out!
@trjExpensify You can still enter any char in Web / Desktop. But I think we can still skip this test.
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:
Space should not be allowed in the year field - it should mirror that of the rate input field.
Actual Result:
Spaces are allowed in the year search field between the numeric digits.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.98-2 / v99-4 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
https://user-images.githubusercontent.com/43996225/231254245-fdc104a2-d8b3-4b2c-bb7d-22fc4756c3ab.mp4
Expensify/Expensify Issue URL: Issue reported by: @priya-zha Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681201745994509
View all open jobs on GitHub
Upwork Automation - Do Not Edit