Skip to content

[Due for payment 2026-04-01] [Due for payment 2026-03-30] Tax - Tax field is blank when expense is created offline #85730

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.40-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: #78472
Email or phone of affected tester (no customers): sdnodisjosijdoisj@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:

  • Enable Taxes in workspace.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Go offline.
  4. Create an expense with any tax rate.
  5. Open the expense.

Expected Result:

Tax field will show the selected rate.

Actual Result:

Tax field is blank when expense is created offline.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7106353_1773846924294.15.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

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 Mar 19, 2026
  2. melvin-bot commented on Mar 19, 2026

    @melvin-bot

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

  3. melvin-bot commented on Mar 19, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 19, 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.
  5. MelvinBot commented on Mar 19, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When an expense is created offline with a tax rate, opening the expense shows the Tax field as blank instead of displaying the selected tax rate.

    What is the root cause of that problem?

    PR #78472 introduced a hasTaxValueChanged check in MoneyRequestView.tsx that doesn't account for offline-created transactions.

    When an expense is created offline, buildOptimisticTransaction() (src/libs/TransactionUtils/index.ts:535-564) sets taxCode and taxAmount but does not set taxName or taxValue (the percentage string like "20%") — those are only populated when the server responds.

    The new display logic at src/components/ReportActionItem/MoneyRequestView.tsx:311-317,601 does:

    1. Destructures {taxCode, taxValue} from the transaction — taxCode is set, but taxValue is undefined
    2. Computes hasTaxValueChanged = getTaxValue(policy, ..., taxCode) !== baseTransaction?.taxValue — this evaluates to "20%" !== undefined = true
    3. Uses taxRateValue = hasTaxValueChanged ? taxValue : (...) — since hasTaxValueChanged is true, it uses taxValue which is undefined
    4. The tax field renders blank

    Before PR #78472, the code simply called getTaxName() to look up the display name from the policy, which worked correctly for offline transactions since the policy data is persisted locally.

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

    In src/components/ReportActionItem/MoneyRequestView.tsx, the hasTaxValueChanged computation should guard against baseTransaction?.taxValue being undefined. When taxValue is undefined (as with offline-created transactions), hasTaxValueChanged should be false so the code falls through to the normal display path that uses getTaxName().

    Change the condition to: only consider the tax value as "changed" when both getTaxValue() returns a value AND baseTransaction?.taxValue is defined. Something like:

    const hasTaxValueChanged = taxCode && taxValue !== undefined
        ? getTaxValue(policy, baseTransaction, taxCode) !== baseTransaction?.taxValue
        : false;
    

    This ensures that offline-created transactions (where taxValue is undefined) skip the "changed" path and fall through to getTaxName() which correctly looks up the tax rate name from the locally-persisted policy data.

    What alternative solutions did you explore? (Optional)

    An alternative would be to include taxValue (the percentage string) in the optimistic transaction built by buildOptimisticTransaction(). However, this would require threading the tax value string through all callers and is a larger change. The guard on hasTaxValueChanged is more targeted and directly addresses the regression.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  6. 7 remaining items

  7. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 23, 2026
  8. changed the title [-]Tax - Tax field is blank when expense is created offline[/-] [+][Due for payment 2026-03-30] Tax - Tax field is blank when expense is created offline[/+] on Mar 23, 2026
  9. melvin-bot commented on Mar 23, 2026

    @melvin-bot

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

  10. melvin-bot commented on Mar 23, 2026

    @melvin-bot

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

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

    • @huult requires payment through NewDot Manual Requests
    • @thesahindia requires payment through NewDot Manual Requests
  11. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    @huult / @thesahindia 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]

  12. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. changed the title [-][Due for payment 2026-03-30] Tax - Tax field is blank when expense is created offline[/-] [+][Due for payment 2026-04-01] [Due for payment 2026-03-30] Tax - Tax field is blank when expense is created offline[/+] on Mar 25, 2026
  14. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.43-3 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 2026-04-01. 🎊

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

    • @huult requires payment through NewDot Manual Requests
    • @thesahindia requires payment through NewDot Manual Requests
  15. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    @huult / @thesahindia @mallenexpensify 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]

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.EngineeringWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions