Skip to content

[Due for payment 2025-03-21] [$250] Expense - Total amount and pay button reload each time any field other than amount is edited #57530

Closed

Description

@mitarachim

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: 9.1.7-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: Exp
Email or phone of affected tester (no customers): applausetester+270205kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Delayed submissions and Add approval are disabled
  • Workspace has no unsettled expense.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Submit a manual expense with currency that is not the default workspace currency.
  4. Go to expense report.
  5. Click any field other than Amount (description, merchant or date).
  6. Edit the amount and save it.

Expected Result:

Total amount and pay button will not reload each time any field other than amount is edited because amount is not modified.

Actual Result:

Total amount and pay button reload each time any field other than amount is edited.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6755962_1740644030293.20250227_161224.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021897119097792368103
  • Upwork Job ID: 1897119097792368103
  • Last Price Increase: 2025-03-05
  • Automatic offers:
    • daledah | Contributor | 106459434
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

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

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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. daledah commented on Feb 27, 2025

    @daledah
    Contributor

    Proposal

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

    Total amount and pay button reload each time any field other than amount is edited.

    What is the root cause of that problem?

    When we update the description or date, ... we will get the calculatedDiffAmount

    App/src/libs/actions/IOU.ts

    Lines 3486 to 3487 in 0856182

    const calculatedDiffAmount = calculateDiffAmount(iouReport, updatedTransaction, transaction);
    // If calculatedDiffAmount is null it means we cannot calculate the new iou report total from front-end due to currency differences.

    calculatedDiffAmount is null in this case because the currency is different from iouReport's currency

    if (updatedCurrency === iouReport.currency && currentCurrency === iouReport.currency) {

    So isTotalIndeterministic is true

    then we add pendingFields for total

    value: {...updatedMoneyRequestReport, ...(isTotalIndeterministic && {pendingFields: {total: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}})},

    If the total is pending we'll show the loading indicator

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

    We should update calculateDiffAmount function to check updatedCurrency === currentCurrency && currentAmount == updatedAmount then return 0

    if (updatedCurrency === currentCurrency && currentAmount == updatedAmount){
            return 0
        }
    

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

    Write test for calculateDiffAmount to cover:

    1. Different currency
    2. Different amount
    3. Same currency
    4. Same amount

    What alternative solutions did you explore? (Optional)

    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. melvin-bot commented on Mar 4, 2025

    @melvin-bot

    @kadiealexander Eep! 4 days overdue now. Issues have feelings too...

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 5, 2025
  6. melvin-bot commented on Mar 5, 2025

    @melvin-bot
  7. changed the title [-]Expense - Total amount and pay button reload each time any field other than amount is edited[/-] [+][$250] Expense - Total amount and pay button reload each time any field other than amount is edited[/+] on Mar 5, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 5, 2025
  9. melvin-bot commented on Mar 5, 2025

    @melvin-bot

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

  10. 22 remaining items

  11. changed the title [-][$250] Expense - Total amount and pay button reload each time any field other than amount is edited[/-] [+][Due for payment 2025-03-21] [$250] Expense - Total amount and pay button reload each time any field other than amount is edited[/+] on Mar 14, 2025
  12. melvin-bot commented on Mar 14, 2025

    @melvin-bot

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

  13. melvin-bot commented on Mar 14, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.12-7 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-03-21. 🎊

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

  14. melvin-bot commented on Mar 14, 2025

    @melvin-bot

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

  15. kadiealexander commented on Mar 20, 2025

    @kadiealexander
    Contributor

    Payments needed:

    @ishpaul777 could you please do the checklist?

  16. ishpaul777 commented on Mar 23, 2025

    @ishpaul777
    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: https://github.com/Expensify/App/pull/56793/files#r2009219945

    • [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. does not block any functionality only a loading indicator till request success

    • [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. - would be good to add test

    Regression Test Proposal

    Precondition:

    • Delayed submissions and Add approval are disabled
    • Workspace has no unsettled expense.

    Test:

    1. Go to staging.new.expensify.com
    2. Go to workspace chat
    3. Submit a manual expense with currency that is not the default workspace currency.
    4. Go to expense report.
    5. Click any field other than Amount (description, merchant or date).
    6. Edit the amount and save it.
    7. Verify Expected Result: Total amount and pay button will not reload each time any field other than amount is edited because amount is not modified.

    Do we agree 👍 or 👎

  17. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Mar 24, 2025
  18. kadiealexander commented on Mar 24, 2025

    @kadiealexander
    Contributor

    Payment summary here.

  19. garrettmknight commented on May 2, 2025

    @garrettmknight
    Contributor

    $250 approved for @ishpaul777

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