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

[ON HOLD for Payment 2/24/25] [$250] Per diem - Quantity field shows error after selecting a subrate #55399

Closed
4 of 8 tasks
vincdargento opened this issue Jan 17, 2025 · 28 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@vincdargento
Copy link

vincdargento commented Jan 17, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.87-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Workspace has per diem rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click + > Submit expense > Per diem.
  4. Select destination > Next.
  5. Select time > Next.
  6. Click Subrate.
  7. Select a subrate.

Expected Result:

Quantity field will not show error after selecting a subrate (production behavior).

Actual Result:

Quantity field shows error after selecting a subrate.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021883939320560472623
  • Upwork Job ID: 1883939320560472623
  • Last Price Increase: 2025-01-27
  • Automatic offers:
    • FitseTLT | Contributor | 105977085
Issue OwnerCurrent Issue Owner: @mananjadhav
@vincdargento vincdargento added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlockerCash This issue or pull request should block deployment labels Jan 17, 2025
Copy link

melvin-bot bot commented Jan 17, 2025

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

Copy link

melvin-bot bot commented Jan 17, 2025

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

Copy link

melvin-bot bot commented Jan 17, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jan 17, 2025
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.

@vincdargento
Copy link
Author

@CortneyOfstad FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@neil-marcellini
Copy link
Contributor

NAB, per diem is behind a beta

@neil-marcellini neil-marcellini added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jan 17, 2025
@shubham1206agra
Copy link
Contributor

@youssef-lr You can take this external.

@melvin-bot melvin-bot bot added the Overdue label Jan 20, 2025
Copy link

melvin-bot bot commented Jan 21, 2025

@youssef-lr, @CortneyOfstad Whoops! This issue is 2 days overdue. Let's get this updated quick!

@CortneyOfstad
Copy link
Contributor

@youssef-lr any update? Thanks!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 22, 2025
@youssef-lr youssef-lr added the External Added to denote the issue can be worked on by a contributor label Jan 27, 2025
@melvin-bot melvin-bot bot changed the title Per diem - Quantity field shows error after selecting a subrate [$250] Per diem - Quantity field shows error after selecting a subrate Jan 27, 2025
Copy link

melvin-bot bot commented Jan 27, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 27, 2025
Copy link

melvin-bot bot commented Jan 27, 2025

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

@FitseTLT
Copy link
Contributor

Proposal

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

Per diem - Quantity field shows error after selecting a subrate

What is the root cause of that problem?

When we press on the subrate menu the text input is blurred and this will set the quantity text input as touched here

setTouchedInput(inputID);

So when we select the subrate that will invoke the validate and field required error will be set here
if (quantityVal === '') {
addErrorMessage(errors, `quantity${pageIndex}`, translate('common.error.fieldRequired'));

because the text input is considered as touched as explained this will show the error
const touchedInputErrors = Object.fromEntries(Object.entries(validateErrors).filter(([inputID]) => touchedInputs.current[inputID]));
if (!lodashIsEqual(errors, touchedInputErrors)) {
setErrors(touchedInputErrors);
}

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

The behaviour is correct because if a user blurs from a text input without inputting a value then that is considered as touched so error will be shown as they have avoided inputting a required value. Because the subrate is the first input in the page to solve the bug on this issue we should avoid auto focusing the quantity text input when the page opens and optionally focus when the user has selected a subrate(optionally we can also additionally focus when the subrate modal is dismissed even without selecting a value).
Remove

const {inputCallbackRef} = useAutoFocusInput();

    const ref = useRef();

onValueChange={(value) => setSubrateValue(value as string)}

 onValueChange={(value) => {
                                setSubrateValue(value as string);
                                InteractionManager.runAfterInteractions(() => {
                                    ref.current.focus();
                                });
                            }}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N / A

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jan 30, 2025
Copy link

melvin-bot bot commented Jan 31, 2025

@mananjadhav @youssef-lr @CortneyOfstad this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@mananjadhav
Copy link
Collaborator

@youssef-lr @CortneyOfstad Can you confirm if the desired behavior is correct? The proposal mentions the behavior is expected.

@FitseTLT While I haven't tested the issue, can you confirm why is it not reproducible on production, but is on staging?

@melvin-bot melvin-bot bot removed the Overdue label Jan 31, 2025
@FitseTLT
Copy link
Contributor

@FitseTLT While I haven't tested the issue, can you confirm why is it not reproducible on production, but is on staging?

@mananjadhav This is because validation on change was only enabled in #54760

@mananjadhav
Copy link
Collaborator

@FitseTLT's proposal makes sense, subject to verifying the expected behavior.

🎀 👀 🎀 C+ reviewed.

Copy link

melvin-bot bot commented Jan 31, 2025

Current assignee @youssef-lr is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@shubham1206agra
Copy link
Contributor

@Gonals Can you please check the proposal too here just to cover all bases here?

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Feb 3, 2025
Copy link

melvin-bot bot commented Feb 3, 2025

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

@mananjadhav
Copy link
Collaborator

The issue was just assigned yesterday. PR will be up soon.

@FitseTLT any ETA on the PR?

@CortneyOfstad
Copy link
Contributor

PR is being actively worked on 👍

@mananjadhav
Copy link
Collaborator

Waiting for a review from @youssef-lr

@mananjadhav
Copy link
Collaborator

@CortneyOfstad The PR was deployed to production yesterday but the payout date isn't updated.

@CortneyOfstad CortneyOfstad added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Feb 19, 2025
@CortneyOfstad
Copy link
Contributor

@mananjadhav I sent you an offer to the job here — can you let me know once you accept?

Also, can you confirm if a regression test is needed?

@CortneyOfstad CortneyOfstad changed the title [$250] Per diem - Quantity field shows error after selecting a subrate [ON HOLD for Payment 2/24/25] [$250] Per diem - Quantity field shows error after selecting a subrate Feb 19, 2025
@mananjadhav
Copy link
Collaborator

@CortneyOfstad I'll be raising the request on NewDot. I've declined the offer on Upwork. Posting the checklist in the next comment.

@mananjadhav
Copy link
Collaborator

mananjadhav commented Feb 19, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: NA

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: NA

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • Beta is enabled Workspace has per diem rates.

Test:

  1. Go to workspace chat.
  2. Click + Submit expense Per diem.
  3. Select destination Next.
  4. Select time Next.
  5. Click Subrate.
  6. Select a subrate.
  7. Verify Quantity field is focused and will not show error after selecting a substrate.
  8. Enter a quantity value and tap outside of the text input to remove the focus
  9. Refocus on the text input by clicking it and delete the value you entered so that the text input will be empty
  10. Verify that field is required error appears

Do we agree 👍 or 👎

@CortneyOfstad
Copy link
Contributor

Payment Summary

@FitseTLT — paid $250 via Upwork
@mananjadhav — to be paid $250 via NewDot

Regression Test

https://github.com/Expensify/Expensify/issues/473909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants