Skip to content

[$250] Expense - Tax name is not shown in merchant rule system message #83174

Closed

Description

@jponikarchuk

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 3.24-1
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: #82438
Email or phone of affected tester (no customers): dreamnitethedragon@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Redminote 10S Android 13
App Component: Money Requests

Action Performed:

Pre-condition: Have workspace with tag enabled & added, tax , rules enabled

  1. Launch app
  2. Go to workspace settings - Rules
  3. Add merchant rule
    Merchant Hi
    Updates to
    Merchant - star merchant
    Category - advertising
    Tag - hrllo
    Tax - Shahrukh tax 5%
    Description - Shahrukh Khan description short
  4. Open workspace chat
  5. Create manual expense with merchant "Hi"
  6. Open the expense
  7. Note system message

set the category to "Advertising", description to "Shahrukh Khan description short", merchant to "Star merchant", tag to "Hrllo", and tax rate to "Tax" via workspace rules

Expected Result:

Tax name must be shown in system message like category, tag, description and merchant.

Actual Result:

Tax name is not shown in system message like category, tag, description and merchant.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @luacmartins
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022025799772686655449
  • Upwork Job ID: 2025799772686655449
  • Last Price Increase: 2026-02-23

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 23, 2026
  2. melvin-bot commented on Feb 23, 2026

    @melvin-bot

    @luacmartins recently merged #82438, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on Feb 23, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 23, 2026

    @melvin-bot

    Triggered auto assignment to @grgia (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Feb 23, 2026

    @melvin-bot

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

  6. github-actions commented on Feb 23, 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.
  7. OSBotify commented on Feb 23, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Backend bug
    Causing PR: #82438 - "Enable merchant rules v2" by @luacmartins (High confidence)
    Related PRs:

    Recommendation: NEEDS INVESTIGATION (Backend team)

    The causing PR (#82438) simply removed the production gate for merchant rules - it did not introduce new functionality, just enabled an existing feature. The bug was latent in the merchant rules implementation but was not caught until the feature was enabled for all users.

    Labels: No label changes needed - this is a backend issue. Keep DeployBlockerCash as the fix requires backend changes.

    Detailed Analysis

    Evidence

    The issue reports that when a merchant rule sets a tax rate on an expense, the system message shows:

    "set the category to "Advertising", description to "Shahrukh Khan description short", merchant to "Star merchant", tag to "Hrllo", and tax rate to "Tax" via workspace rules"

    Notice it says tax rate to "Tax" instead of showing the actual tax name "Shahrukh tax 5%".

    Root Cause

    The frontend code is correct and has proper handling for tax names:

    1. src/libs/ModifiedExpenseMessage.ts (lines 220-224) extracts the tax name:
    if (key === 'tax') {
        const taxEntry = value as PolicyRulesModifiedFields['tax'];
        const taxRateName = taxEntry?.field_id_TAX.name ?? '';
        return translate('iou.policyRulesModifiedFields.tax', taxRateName, isFirst);
    }
    1. Unit tests in tests/unit/ModifiedExpenseMessageTest.ts (lines 863-887) verify this functionality works correctly when the data structure is properly populated.

    2. Type definitions in src/types/onyx/OriginalMessage.ts and src/types/onyx/ExpenseRule.ts show the expected structure:

    tax?: {
        field_id_TAX: PolicyRuleTaxRate; // { externalID, value, name }
    };

    Backend Issue

    The backend is not populating the policyRulesModifiedFields.tax.field_id_TAX.name field correctly when applying merchant rules. The frontend receives the data structure but the name field is either missing or contains a placeholder value ("Tax") instead of the actual tax rate name.

    This is a backend bug in the merchant rules application logic that needs to be fixed by the backend team. The backend code (likely in Web-Expensify or PHP codebase) needs to ensure it includes the full tax rate details including the name when populating policyRulesModifiedFields.

    Fix Location

    • Backend: Web-Expensify repository - merchant rule application logic needs to populate tax name
    • Not an App (frontend) bug: The frontend code correctly handles the data structure when properly provided
  8. 6 remaining items

  9. melvin-bot commented on Feb 23, 2026

    @melvin-bot
  10. marufsharifi commented on Feb 23, 2026

    @marufsharifi

    This is a backend issue. In OpenReport, the MODIFIEDEXPENSE payload has policyRulesModifiedFields.tax.field_id_TAX.name = "Tax" while the same response has the correct rate name in policy.taxRates.taxes[id_TAX_RATE_1].name = "Test Tax Rate 1" The app only renders field_id_TAX.name, so BE should populate that field with the specific tax rate name (policy.taxRates.taxes[externalID].name), not the container label.

  11. luacmartins commented on Feb 23, 2026

    @luacmartins
    Contributor

    #82438 was reverted so this is NAB.

  12. luacmartins commented on Feb 24, 2026

    @luacmartins
    Contributor

    PR in review

  13. added
    ReviewingHas a PR in review
    and removed
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 24, 2026
  14. luacmartins commented on Mar 3, 2026

    @luacmartins
    Contributor

    PR deployed

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.DailyKSv2EngineeringReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions