Skip to content

Expense - Converted amount is the same as unconverted amount for unedited split #80170

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.3.6-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #79547
Email or phone of affected tester (no customers): oijiojnojinjijijio@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense in foreign currency.
  4. Open the expense report.
  5. Click More > Split > Save.
  6. Open any split.
  7. Go offline.
  8. Click Amount.
  9. Edit the split and save it.
  10. Open the unedited split

Expected Result:

Converted amount should remain unchanged for unedited split.

Actual Result:

Converted amount is the same as unconverted amount for unedited split.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7055124_1769040102330.4.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jan 22, 2026
  2. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #79547

  3. melvin-bot commented on Jan 22, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 22, 2026

    @melvin-bot

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

  5. github-actions commented on Jan 22, 2026

    @github-actions
    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.
  6. OSBotify commented on Jan 22, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #79547 - "fix: Report - Total amount shown as '0,00' when splitting expense offline after currency change" by @TaduJR (High confidence)
    Related Issues: Fixed #78814 but introduced this new regression

    Recommendation: REVERT

    PR #79547 introduced logic to calculate proportional convertedAmount for split transactions, but it has a critical bug: when editing ANY split transaction, the convertedAmount gets recalculated for ALL splits (including unedited ones) based on the original transaction. This causes unedited splits to show incorrect converted amounts.

    Labels: This is a Frontend bug. The fix needs to happen in the App repository. Keeping DeployBlockerCash label. Removing DeployBlocker label as this does not block the backend/Web deploy.

    📋 Detailed Analysis

    Evidence

    The reproduction steps clearly show:

    1. Split an expense in foreign currency offline
    2. Edit ONE split
    3. Open an UNEDITED split
    4. The converted amount is incorrectly changed to match the unconverted amount

    This matches exactly what PR #79547 changed. The PR added logic to calculate convertedAmount proportionally when splitting expenses.

    Verification

    The bug is in /home/runner/work/App/App/src/libs/actions/IOU/index.ts at lines 3235-3247, which was added by PR #79547:

    if (isSplitExpense && existingTransaction) {
        const {convertedAmount: originalConvertedAmount, ...existingTransactionWithoutConvertedAmount} = existingTransaction;
        optimisticTransaction = fastMerge(existingTransactionWithoutConvertedAmount, optimisticTransaction, false);
    
        // Calculate proportional convertedAmount for the split based on the original conversion rate
        const originalAmount = Number(existingTransaction.modifiedAmount) || existingTransaction.amount;
        const splitAmount = Number(optimisticTransaction.modifiedAmount) || optimisticTransaction.amount;
        if (originalConvertedAmount && originalAmount && splitAmount) {
            optimisticTransaction.convertedAmount = Math.round((originalConvertedAmount * splitAmount) / originalAmount);
        }
    }

    Root Cause

    When updateSplitTransactions is called (line 13858 in the same file), it passes existingTransaction: originalTransaction to getMoneyRequestInformation. This causes the above code to execute for EVERY split transaction being processed, not just new ones.

    The problem is that:

    1. existingTransaction is the parent/original transaction that was split
    2. The code recalculates convertedAmount for ALL splits based on this original transaction
    3. When editing one split offline, this recalculation incorrectly runs for unedited splits too
    4. Unedited splits should maintain their existing convertedAmount, not have it recalculated

    The fix should distinguish between:

    • Creating NEW split transactions (where convertedAmount calculation is correct)
    • Updating EXISTING split transactions (where convertedAmount should only be recalculated if the amount changed)
  7. lakchote commented on Jan 22, 2026

    @lakchote
    Contributor

    cc @TaduJR @suneox coming from #79547

  8. suneox commented on Jan 22, 2026

    @suneox
    Contributor

    This issue doesn’t seem to be caused by the #79547 change set but isn’t reproducible on the latest prod so waiting for @TaduJR to revert locally and confirm.

    CleanShot.2026-01-22.at.13.38.24.mp4
  9. TaduJR commented on Jan 22, 2026

    @TaduJR
    Contributor

    BE issue not regression from #79547

    What is the expected behavior of the backend?

    When Transaction_Split is called, the backend should either:

    1. Not return the original transaction in onyxData, OR
    2. Return the original transaction with its correct convertedAmount preserved

    What is the actual behavior of the backend?

    The backend returns the original transaction in onyxData with convertedAmount incorrectly set equal to amount, overwriting the client's correct foreign currency conversion value.


    What data are you passing to the backend?

    Endpoint: Transaction_Split

    transactionID: 3807893813045614263
    splits[0][amount]: 500
    splits[0][transactionID]: 1908198590938613835
    splits[1][amount]: 500
    splits[1][transactionID]: 4777380546091873117
    

    Original transaction state before API call:

    {
      "transactionID": "3807893813045614263",
      "amount": -1000,
      "currency": "USD",
      "convertedAmount": -3673
    }

    What data is the backend returning?

    The backend returns the original transaction with incorrect convertedAmount:

    {
      "key": "transactions_3807893813045614263",
      "onyxMethod": "merge",
      "value": {
        "amount": -1000,
        "convertedAmount": -1000, 🚨💥
        "currency": "USD",
        "transactionID": "3807893813045614263"
      }
    }

    What data do you think the backend should be returning?

    Either:

    1. Do not include the original transaction in onyxData response, OR
    2. Return the original transaction with correct convertedAmount:
    {
      "key": "transactions_3807893813045614263",
      "onyxMethod": "merge",
      "value": {
        "amount": -1000,
        "convertedAmount": -3673,
        "currency": "USD",
        "transactionID": "3807893813045614263"
      }
    }
  10. lakchote commented on Jan 22, 2026

    @lakchote
    Contributor

    Demoting as it's a BE issue (see post above)

  11. added
    ReviewingHas a PR in review
    and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jan 22, 2026
  12. lakchote commented on Jan 26, 2026

    @lakchote
    Contributor

    @TaduJR you can resume working on your PR

  13. melvin-bot commented on Feb 16, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @lakchote, @laurenreidexpensify eroding to Weekly issue.

  14. lakchote commented on Feb 16, 2026

    @lakchote
    Contributor

    Should have been fixed by https://github.com/Expensify/Auth/pull/19435 and #74189.

    Closing the issue.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions