Skip to content
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

[$250] WS - "Rule" tab has unnecessarly long input field for "Days" section #48284

Closed
2 of 6 tasks
IuliiaHerets opened this issue Aug 29, 2024 · 26 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 29, 2024

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: v9.0.26-1
Reproducible in staging?: Y
Reproducible in production?: Can't check
Email or phone of affected tester (no customers): applausetester+en@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Access staging.new.expensify.com
  2. Sign into a valid account
  3. Go to Workspace > Workflow > Enable rules
  4. Go to "Max Expense Age'" and input a very high number (Note that this field is for Flagging spend older than a specific number of days.)

Expected Result:

User expects that there is a limit of days that can be input and that this limit is reasonable

Actual Result:

User can input absurdly large number of days, numbers that are highly unrealistic for a field like this

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6586795_1724948360909.Absurd_number_of_days.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0183e993ca7b36650e
  • Upwork Job ID: 1831043219902619216
  • Last Price Increase: 2024-09-03
  • Automatic offers:
    • ishpaul777 | Reviewer | 103822043
    • Nodebrute | Contributor | 103822045
Issue OwnerCurrent Issue Owner: @ishpaul777
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

Triggered auto assignment to @chiragsalian (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Aug 29, 2024

Triggered auto assignment to @anmurali (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.

@melvin-bot melvin-bot bot added the Daily KSv2 label Aug 29, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Aug 29, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@puneetlath
Copy link
Contributor

Demoting since rules are in beta

@puneetlath puneetlath added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Aug 29, 2024
@neonbhai
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

"Rule" tab has unnecessarly long input field for "Days" section

What is the root cause of that problem?

We set the maxLength for this field to be 50 characters long:

maxLength={CONST.FORM_CHARACTER_LIMIT}

What changes do you think we should make in order to solve the problem?

We will update the maxLength here to a reasonable number, ex. 4 or 5

@Nodebrute
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

The "Rule" tab has unnecessarily long input field for the "Days" section

What is the root cause of that problem?

We are setting the maxlength to 50

maxLength={CONST.FORM_CHARACTER_LIMIT}

What changes do you think we should make in order to solve the problem?

Remove maxLength from here

maxLength={CONST.FORM_CHARACTER_LIMIT}

and in here we should add the limit on digits we can do something like this

 // replace all characters that are not spaces or digits
        let validMaxExpenseAge = newValue.replace(/[^0-9]/g, '');
    // gets only the first 5 digits if the inputted number have more digits than that
        validMaxExpenseAge = validMaxExpenseAge.match(/(?:\d *){1,5}/)?.[0] ?? '';
        setMaxExpenseAgeValue(validMaxExpenseAge);

In the above code we can add limit of our choice. This is the same approach we follow in PaymentCardForm

const onChangeCardNumber = useCallback((newValue: string) => {
// replace all characters that are not spaces or digits
let validCardNumber = newValue.replace(/[^\d ]/g, '');
// gets only the first 16 digits if the inputted number have more digits than that
validCardNumber = validCardNumber.match(/(?:\d *){1,16}/)?.[0] ?? '';

Why should we prefer this approach over using max_length? The difference is that when copying numbers with spaces and pasting them here, max_length will count the spaces as well, which can affect the input.

With `maxLength={5}`
Screen.Recording.2024-08-29.at.11.33.26.PM.mov
With my solution
Screen.Recording.2024-08-29.at.11.36.46.PM.mov
The proposed solution will make this field's behavior consistent with the other fields on the rules page. In this field max limit is 8
Screen.Recording.2024-08-29.at.11.39.10.PM.mov

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

@anmurali, @chiragsalian Eep! 4 days overdue now. Issues have feelings too...

@chiragsalian
Copy link
Contributor

marking issue as external

@melvin-bot melvin-bot bot removed the Overdue label Sep 3, 2024
@chiragsalian chiragsalian added the External Added to denote the issue can be worked on by a contributor label Sep 3, 2024
@melvin-bot melvin-bot bot changed the title WS - "Rule" tab has unnecessarly long input field for "Days" section [$250] WS - "Rule" tab has unnecessarly long input field for "Days" section Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0183e993ca7b36650e

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 (External)

@ishpaul777
Copy link
Contributor

will review proposals today.

@ishpaul777
Copy link
Contributor

@Nodebrute's Proposal sounds good to me 👍

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 4, 2024

Current assignee @chiragsalian is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@chiragsalian
Copy link
Contributor

Proposal LGTM, feel free to create the PR @Nodebrute.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

📣 @ishpaul777 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Sep 4, 2024

📣 @Nodebrute 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 5, 2024
@Nodebrute
Copy link
Contributor

@chiragsalian Could you please verify the number of digits allowed for the max expense age? Currently, I have set the limit to 5.

cc: @ishpaul777

@ishpaul777
Copy link
Contributor

i defer decision to @chiragsalian

@chiragsalian
Copy link
Contributor

Yup 5 for now sounds good to me. With 5 digits user can enter 99999 which is 273 years, so yeah that's more than good enough for me.

@Nodebrute
Copy link
Contributor

@anmurali Hey, it was deployed to production in #48954. the payment is due today.

@Nodebrute
Copy link
Contributor

@anmurali Bump for payment.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Sep 30, 2024
Copy link

melvin-bot bot commented Sep 30, 2024

This issue has not been updated in over 15 days. @anmurali, @chiragsalian, @Nodebrute, @ishpaul777 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Sep 30, 2024
@Nodebrute
Copy link
Contributor

@anmurali gentle bump for payment

@ishpaul777
Copy link
Contributor

Bumped this issue internally

@anmurali
Copy link

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants