Skip to content

Expense - Wrong tax total when unreported expense is added offline #81943

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.16-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #80079
Email or phone of affected tester (no customers): sjiondjsondjoisjsojdos@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Taxes are enabled.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Create an expense with non-zero tax rate.
  4. Go to workspace chat.
  5. Create an expense with different amount non-zero tax rate.
  6. Open the report.
  7. Go offline.
  8. Click More > Add expenses > Add unreported expense.
  9. Select the self DM expense from Step 3 and click Add unreported expense.

Expected Result:

Tax total will be the sum of tax from workspace expense and self DM expense.

Actual Result:

Tax total is not the sum of tax from workspace expense and self DM expense.
It only updates to the correct sum after returning online.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7073264_1770710157850.6.mp4

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Feb 10, 2026
  2. melvin-bot commented on Feb 10, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 10, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 10, 2026

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (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 Feb 10, 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 Feb 10, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #80079 - "feat: Add Billable and Tax subtotals to the report view" by @nkdengineer (High confidence)
    Related Issues: #78927 (original feature request)

    Recommendation: REVERT

    PR #80079 introduced a bug in the offline calculation of tax totals. The getBillableAndTaxTotal function uses convertedTaxAmount which is not available when offline, causing incorrect tax totals until the user goes back online.

    Labels: Removing DeployBlocker label as this is a frontend bug that requires changes in App, not the backend. Keeping DeployBlockerCash to block the App deploy.

    📋 Detailed Analysis

    Evidence

    The issue specifically states:

    • Tax total is incorrect when adding unreported expenses offline (step 7-9)
    • It only updates to the correct sum after returning online

    PR #80079 was explicitly mentioned in the issue as the source, and melvin-bot auto-assigned it based on this PR.

    Verification

    PR #80079 modified the following key files:

    • src/libs/ReportUtils.ts - Added getBillableAndTaxTotal function
    • src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx - Uses the new function
    • src/components/ReportActionItem/MoneyReportView.tsx - Uses the new function
    • src/types/onyx/Transaction.ts - Added convertedTaxAmount field

    The merge date was 2026-02-06, which aligns with this being in the 9.3.16-0 staging release.

    Root Cause

    In src/libs/ReportUtils.ts lines 4386-4391, the getBillableAndTaxTotal function calculates tax totals:

    if (taxAmount) {
        if (currency === report?.currency) {
            taxTotal += taxAmount;
        } else {
            taxTotal -= transaction?.convertedTaxAmount ?? 0;
        }
    }

    The Problem: When a transaction has a different currency than the report, the function relies on convertedTaxAmount. This value is populated by the backend API after currency conversion. When offline, this field is undefined, so it defaults to 0 (via the ?? 0 operator), resulting in an incorrect tax total calculation.

    The same issue exists for billable amounts with convertedAmount on lines 4380-4384.

    When the user goes back online, the API returns the convertedTaxAmount value, which updates the tax total to the correct amount.

  7. nkdengineer commented on Feb 10, 2026

    @nkdengineer
    Contributor

    @mjasikowski Let me know if you want to revert or add a quick fix for blockers related to #78927

  8. melvin-bot commented on Feb 10, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  9. mjasikowski commented on Feb 10, 2026

    @mjasikowski
    Contributor

    @nkdengineer we'll revert so we have more time to test the fixes

  10. nkdengineer commented on Feb 10, 2026

    @nkdengineer
    Contributor

    @mjasikowski Got it. Please help to create a revert, I will create another PR.

  11. mjasikowski commented on Feb 10, 2026

    @mjasikowski
    Contributor

    PR reverted, removed blocker label. 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.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions