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

[HOLD for payment 2025-02-05] [$250] Web - Distance - Create a distance to a user display an error message #55258

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

Comments

@izarutskaya
Copy link

izarutskaya commented Jan 15, 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: v9.0.85-4
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: #55220
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Windows 11 / Chrome
App Component: Chat Report View

Action Performed:

  1. Open the http://staging.new.expensify.com/
  2. Click on the FAB
  3. Click on the Create expense
  4. Click on the Distance
  5. Select location over 44 Kilometers
  6. Click the Next button
  7. Click on a user DM from the recent list or enter one
  8. Click on the Submit button

Expected Result:

The web should allow the user to create the distance expense normally

Actual Result:

When creating a distance and submit to an individual user it displays an error message

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Image

Bug6714487_1736919221563.Invalid_amount_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021879503209059502176
  • Upwork Job ID: 1879503209059502176
  • Last Price Increase: 2025-01-15
  • Automatic offers:
    • nkdengineer | Contributor | 105798427
Issue OwnerCurrent Issue Owner: @mallenexpensify
@izarutskaya izarutskaya added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@nkdengineer
Copy link
Contributor

nkdengineer commented Jan 15, 2025

Proposal

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

When creating a distance and submit to an individual user it displays an error message

What is the root cause of that problem?

We have CONST.IOU.AMOUNT_MAX_LENGTH = 8

With long distances and small currency values ​​the amount here will have more than 8 digits and we get an error

if (isDistanceRequest && !isDistanceRequestWithPendingRoute && !MoneyRequestUtils.validateAmount(String(iouAmount), decimals)) {
setFormError('common.error.invalidAmount');
return;
}

function validateAmount(amount: string, decimals: number, amountMaxLength: number = CONST.IOU.AMOUNT_MAX_LENGTH, shouldAllowNegative = false): boolean {

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

We should pass amount max length for case isDistanceRequest is 10

         validateAmount(String(iouAmount), decimals, 10)) {
              setFormError('common.error.invalidAmount');
              return;
          }

if (isDistanceRequest && !isDistanceRequestWithPendingRoute && !MoneyRequestUtils.validateAmount(String(iouAmount), decimals)) {
setFormError('common.error.invalidAmount');
return;
}

We have this PR to fix changing amount max length from 10 to 8 because with amount having more than 10 digits, manual request will fail in BE side.
I tried it in case distance request and there was no problem.

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

What alternative solutions did you explore? (Optional)

NA

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Copy link
Contributor

⚠️ @nkdengineer Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format.

@WoLewicki
Copy link
Contributor

@nkdengineer could you elaborate if the bump of mapbox caused this issue?

@mountiny
Copy link
Contributor

this does not seem related but maybe they just found it as they tested the flow more.

This is is not marked as deploy blocker so probably not

@WoLewicki
Copy link
Contributor

It was linked in my PR: #55220, that's why I'm asking. Thanks for info!

@nkdengineer
Copy link
Contributor

@nkdengineer could you elaborate if the bump of mapbox caused this issue?

@WoLewicki It seems unrelated to your PR, this issue is about us setting amountMaxLength smaller than the amount of the transaction.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@melvin-bot melvin-bot bot changed the title Web - Distance - Create a distance to a user display an error message [$250] Web - Distance - Create a distance to a user display an error message Jan 15, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

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

@nkdengineer
Copy link
Contributor

@c3024 could you please review my proposal here?

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

melvin-bot bot commented Jan 21, 2025

@mallenexpensify, @mountiny, @c3024 Eep! 4 days overdue now. Issues have feelings too...

@c3024
Copy link
Contributor

c3024 commented Jan 21, 2025

@nkdengineer 's proposal LGTM!.

Backend does not seem to throw any error for any number of digits for the amount for distance requests. We can match the limit existing on backend on frontend too. If there is no limit on backend we can omit validating for the number of digits on frontend too for distance requests.

🎀 👀 🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Jan 21, 2025
Copy link

melvin-bot bot commented Jan 21, 2025

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

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Jan 21, 2025
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 21, 2025
Copy link

melvin-bot bot commented Jan 21, 2025

📣 @nkdengineer 🎉 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 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Jan 22, 2025
@melvin-bot melvin-bot bot changed the title [$250] Web - Distance - Create a distance to a user display an error message [HOLD for payment 2025-02-05] [$250] Web - Distance - Create a distance to a user display an error message Jan 29, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 29, 2025
Copy link

melvin-bot bot commented Jan 29, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jan 29, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.90-6 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 2025-02-05. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jan 29, 2025

@c3024 @mallenexpensify @c3024 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 4, 2025
@c3024
Copy link
Contributor

c3024 commented Feb 6, 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: This was a mismatch between the frontend and backend restrictions on the amount for different type of money requests. No PR can be held responsible

  • [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: Not critical enough to warrant a discussion.

  • [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.

Regression Test Proposal Template
  • [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:

Test:

  1. Click on FAB
  2. Click on Create expense
  3. Click on Distance tab
  4. Select locations so that distance between the locations is a very large number (like Oslo and Beijing).
  5. Click the Next button.
  6. Click on a user DM from the recent list or enter one.
  7. Click on the Submit button
  8. Verify that there is no error thrown and the request is submitted successfully.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Feb 6, 2025
@mallenexpensify
Copy link
Contributor

mallenexpensify commented Feb 6, 2025

Contributor: @nkdengineer paid $250 via Upwork
Contributor+: @c3024 due $250 via NewDot

Test case created

Thx!

@melvin-bot melvin-bot bot removed the Overdue label Feb 6, 2025
@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Feb 6, 2025
@JmillsExpensify
Copy link

$250 approved for @c3024

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

7 participants