Skip to content

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

Closed

Description

@izarutskaya

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.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): luongquocvu92@gmail.com
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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 15, 2025
  2. melvin-bot commented on Jan 15, 2025

    @melvin-bot

    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.

  3. nkdengineer commented on Jan 15, 2025

    @nkdengineer
    Contributor

    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.

  4. github-actions commented on Jan 15, 2025

    @github-actions
    Contributor

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

  5. WoLewicki commented on Jan 15, 2025

    @WoLewicki
    Contributor

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

  6. mountiny commented on Jan 15, 2025

    @mountiny
    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

  7. WoLewicki commented on Jan 15, 2025

    @WoLewicki
    Contributor

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

  8. nkdengineer commented on Jan 15, 2025

    @nkdengineer
    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.

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 15, 2025
  10. melvin-bot commented on Jan 15, 2025

    @melvin-bot
  11. 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[/+] on Jan 15, 2025
  12. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 15, 2025
  13. 18 remaining items

  14. 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[/+] on Jan 29, 2025
  15. melvin-bot commented on Jan 29, 2025

    @melvin-bot

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

  16. melvin-bot commented on Jan 29, 2025

    @melvin-bot

    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:

  17. melvin-bot commented on Jan 29, 2025

    @melvin-bot

    @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]

  18. c3024 commented on Feb 6, 2025

    @c3024
    Contributor

    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 👎

  19. mallenexpensify commented on Feb 6, 2025

    @mallenexpensify
    Contributor

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

    Test case created

    Thx!

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Feb 6, 2025
  21. JmillsExpensify commented on Mar 3, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @c3024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions