Skip to content

Previously created expense not updated after editing workspace rules #82225

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.17-6
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: #81033
Email or phone of affected tester (no customers): kiatest.80+ck21126300@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: iPhone 16/iOS 18.7.1
App Component: Money Requests

Action Performed:

  1. Launch Hybrid app
  2. As admin invite member to workspace
  3. Enable Tags, Select "Billable" in Billable default in Rules page
  4. As admin, create a comprehensive rule:
    Merchant: "TestCorp"
    Match type: Contains
    Category: "Software"
    Tag: "Project X"
    Reimbursable: No
    Billable: Yes
    Description: "TestCorp subscription"
    Rename merchant to: "TestCorp Inc."
    5.As member, create a new expense with merchant: "TestCorp Services"
  5. Verify all fields are updated correctly as per the workspace rules
  6. As admin, edit the rule and change the category
  7. Toggle on Apply to existing unsubmitted expenses & Save rule
  8. Navigate to member created expense
  9. Observe previously created expense is not updated

Expected Result:

Previously created expense should be updated after editing workspace rules

Actual Result:

Previously created expense not updated after editing workspace rules. Only "changed the expense" system message displayed in expense details but still old category is seen. No changes reflect on member side as well

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: @JS00001

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Feb 12, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 12, 2026

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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 12, 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 12, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Backend bug
    Causing PR: #81033 - "Enable merchant rules" by @luacmartins (High confidence)
    Related PRs: #80851 - "Allow admins to apply rule changes to existing unsubmitted expenses" (not in current staging deploy)

    Recommendation: REVERT

    PR #81033 should be reverted to prevent shipping a broken feature to production. The PR simply removed the production environment check that was hiding the merchant rules feature, but the underlying backend functionality for applying rules to existing expenses is broken.

    Labels: Keeping DeployBlockerCash - While this is a backend bug, reverting the App PR will hide the broken feature from users until the backend is fixed.

    Detailed Analysis

    Evidence

    PR #81033 removed the production gate on merchant rules, exposing the feature to all users. During regression testing of this PR, QA discovered that the "Apply to existing unsubmitted expenses" toggle does not work correctly - expenses show a "changed the expense" system message but the actual field values (category, tags, etc.) are not updated.

    Verification

    The frontend code correctly implements the feature:

    • src/pages/workspace/rules/MerchantRules/MerchantRulePageBase.tsx line 95: Toggle state shouldUpdateMatchingTransactions
    • src/libs/actions/Policy/Rules.ts line 200: Passes the flag to setPolicyCodingRule
    • src/libs/actions/Policy/Rules.ts line 223: Sends shouldUpdateMatchingTransactions parameter to backend API

    The App sends the correct parameter to the backend, but the backend fails to properly update the expense fields. Evidence:

    1. System message "changed the expense" appears (backend acknowledges the request)
    2. But expense fields remain unchanged (backend fails to apply updates)
    3. No frontend code attempts to update transactions locally - this is entirely a backend responsibility

    Root Cause

    The backend API endpoint for SetPolicyCodingRule receives the shouldUpdateMatchingTransactions parameter but does not correctly apply rule updates to existing matching expenses. This is a backend implementation bug, not a frontend issue.

    The feature for applying rules to existing expenses was added in PR #80851 (not in current staging), but only the frontend UI was implemented. The backend functionality appears incomplete or broken.

  7. self-assigned this
    on Feb 12, 2026
  8. JS00001 commented on Feb 12, 2026

    @JS00001
    Contributor
    Screen.Recording.2026-02-12.at.8.51.36.AM.mov

    I'm not able to repro this one 🤔

  9. JS00001 commented on Feb 12, 2026

    @JS00001
    Contributor

    Ah, its category specifically that isn't changing

  10. JS00001 commented on Feb 12, 2026

    @JS00001
    Contributor

    pr open, waiting to see if this intentional or not

  11. izarutskaya commented on Feb 12, 2026

    @izarutskaya

    Still reproducible
    Build 9.3.17-9
    Windows 11 / Chrome

    change.rule.mp4
    Recording.3631.mp4

    iPhone 13 / iOS 18.7.1
    Build 9.3.17-9

    merchant.ios.MP4
    Screenrecording.02-12-2026.4-34-45.Pm.1.mp4
  12. added and removed on Feb 12, 2026
  13. JS00001 commented on Feb 12, 2026

    @JS00001
    Contributor

    Working on a PR for this, discussing this change here: https://new.expensify.com//r/7403766491155691/8092209370328081648

  14. JS00001 commented on Feb 12, 2026

    @JS00001
    Contributor

    We cp'd a fix to disable this on prod, so this is NAB

  15. melvin-bot commented on Feb 16, 2026

    @melvin-bot

    @JS00001 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  16. JS00001 commented on Feb 17, 2026

    @JS00001
    Contributor

    This is fixed

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions