Skip to content

Rules - Rules are not applied to all merchants after saving merchant with an asterisk (*) #81107

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: 9.3.11-17
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: #80915
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least one workspace.

  1. Open the Expensify app.
  2. Navigate to "Account" > "Expense Rules"
  3. Tap on "New Rule"
  4. On "If expense contains" tap on "Merchant"
  5. Note that a "Type (*) to create a rule that applies to all merchants" message is visible below input.
  6. Type an asterisk (*) and save.
  7. On "Then apply these updates", add any category, description and any report name.
  8. Save the created rule.
  9. Navigate to workspace chat.
  10. Create a manual expense with any merchant.
  11. Note that rules are not applied.
  12. Delete the just created expense.
  13. Create a new manual expense with an asterisk (*) as merchant.
  14. Note that rules are not applied to the expense.

Expected Result:

When user creates a rule and saves the merchant as an asterisk (*) in "If expense contains", the created rule should be applied to expenses created with any merchant.

Actual Result:

Rules are not applied to any merchant after creating a new rule and saving merchant as an asterisk (*) in "If expense contains".

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

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Jan 31, 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 Jan 31, 2026

    @melvin-bot

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

  5. melvin-bot commented on Jan 31, 2026

    @melvin-bot

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

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Backend bug
    Causing PR: N/A - No App PR caused this issue (Low confidence)
    Related PRs:

    Recommendation: NEEDS INVESTIGATION

    This appears to be a backend bug where the rule matching logic does not properly handle wildcard () merchant matching. The App correctly allows users to create rules with () as the merchant (with the hint "Type (*) to create a rule that applies to all merchants"), but when expenses are created, the backend is not applying these wildcard rules.

    Why this is a backend bug:

    • No App PR introduced broken logic - this is a new feature working as designed on the frontend
    • The App successfully saves rules with (*) merchant
    • The bug occurs during expense creation when the backend attempts to match and apply rules
    • The fix requires backend changes to implement proper wildcard merchant matching

    Labels: DeployBlockerCash label should be REMOVED since this requires a backend fix, not an App revert.

    Detailed Analysis

    Evidence

    The issue clearly states:

    1. Users can create a rule with (*) as merchant
    2. The UI shows "Type (*) to create a rule that applies to all merchants"
    3. Rules are saved successfully
    4. When creating expenses (with any merchant OR with (*) as merchant), rules are NOT applied

    Feature Context

    Personal expense rules is a NEW feature (version 9.3.11-17, N/A in production):

    Root Cause

    The rule matching logic lives in the backend. When a user creates an expense, the backend should:

    1. Fetch the user's expense rules
    2. Match the expense merchant against rule criteria
    3. Apply matching rules to the expense

    The backend is failing to recognize (*) as a wildcard that should match all merchants. This is not an App bug because:

    • The App has no control over when/how rules are applied
    • The App simply saves rules via SetNameValuePair API calls
    • Rule application happens server-side during expense creation

    Recommended Action

    Tag backend engineers to investigate and fix the wildcard merchant matching logic in the rule application system. The frontend is working correctly.

  8. 22 remaining items

  9. melvin-bot commented on Feb 9, 2026

    @melvin-bot

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

  10. github-actions commented on Feb 9, 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.
  11. melvin-bot commented on Feb 9, 2026

    @melvin-bot

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

  12. melvin-bot commented on Feb 9, 2026

    @melvin-bot

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

  13. melvin-bot commented on Feb 9, 2026

    @melvin-bot

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

  14. melvin-bot commented on Feb 9, 2026

    @melvin-bot

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

  15. melvin-bot commented on Feb 9, 2026

    @melvin-bot

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

  16. OSBotify commented on Feb 9, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #79659 - "Expense rules phase 2" by @situchan (High confidence)
    Fix PR: #81177 - "Update "use *" to "use ."" by @JS00001 (Already merged to main)
    Related Issues: Part of #75903

    Recommendation: DEMOTE

    This issue has already been fixed in PR #81177, which corrected the merchant hint text from "*" to "." to match OldDot/Classic behavior. The fix is merged to main but not yet in the current staging deploy.

    Why DEMOTE:

    1. The issue has already been fixed - PR Update "use *" to "use ." #81177 is merged to main
    2. The fix will automatically be included in the next staging deploy
    3. This is a new feature (N/A in production per the issue description)
    4. The feature works correctly with the proper wildcard character "."
    5. The original PR author marked this as NAB (Not A Blocker) after the fix was merged

    Labels: REMOVE DeployBlockerCash - this does not need to block the current App deploy since the fix is already in main and will ship in the next cycle.

    Detailed Analysis

    Evidence

    Timeline of events:

    1. PR Expense rules phase 2 #79659 (Jan 22): Introduced expense rules phase 2 with create/edit/delete functionality, including merchant hint text saying "Type * to create a rule that applies to all merchants"
    2. PR show Expense Rules tab in Account settings #80915 (Jan 30): Made the Expense Rules tab visible in Account settings, exposing the feature to users
    3. Issue Rules - Rules are not applied to all merchants after saving merchant with an asterisk (*) #81107 (Jan 31): Reported that wildcard merchant matching with "*" does not work
    4. PR Update "use *" to "use ." #81177 (Feb 2): Fixed by changing hint text from "*" to "." to match OldDot behavior - MERGED

    Root cause:
    The frontend code in PR #79659 incorrectly told users to use "*" as the wildcard character for merchant matching. However, the backend (inherited from OldDot/Classic) expects "." as the wildcard character. This was a frontend documentation/UX bug, not a backend logic bug.

    Verification

    I verified that:

    1. PR Expense rules phase 2 #79659 introduced the incorrect merchantHint text with "*" in all language files
    2. PR Update "use *" to "use ." #81177 corrected all language files to use "." instead
    3. The current main branch code shows the correct hint: merchantHint: 'Type . to create a rule that applies to all merchants'
    4. PR Update "use *" to "use ." #81177 has been merged and is in main (merged on 2026-02-02T14:53:18Z)

    Root Cause

    This was a frontend UX bug where the hint text did not match the backend implementation:

    • Frontend (incorrect): Told users to type "*" for wildcard matching
    • Backend (correct): Expected "." for wildcard matching (as used in OldDot/Classic)
    • Fix: Updated frontend hint text to match backend expectation

    The backend rule matching logic was working correctly all along - it just required the correct wildcard character that OldDot has always used.

    Current Status

    The issue is already resolved in the codebase. The fix (PR #81177) is merged to main and will be included in the next staging deploy. No further action is needed except to remove the deploy blocker label since this does not warrant blocking the current deploy.

  17. pecanoro commented on Feb 9, 2026

    @pecanoro
    Contributor

    Ok, Melvin didn't remove my label so that's good! Closing again

  18. OSBotify commented on Feb 9, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #79659 - Expense rules phase 2 by @situchan (High confidence)
    Fix PR: #81177 - Update wildcard from * to . by @JS00001 (Already merged to main)
    Related Issues: Part of #75903

    Recommendation: DEMOTE

    This issue has already been fixed in PR #81177, which corrected the merchant hint text from * to . to match OldDot/Classic behavior. The fix is merged to main but not yet in the current staging deploy.

    Why DEMOTE:

    1. The issue has already been fixed - PR Update "use *" to "use ." #81177 is merged to main
    2. The fix will automatically be included in the next staging deploy
    3. This is a new feature (N/A in production per the issue description)
    4. The feature works correctly with the proper wildcard character .
    5. The original PR author marked this as NAB (Not A Blocker) after the fix was merged

    Labels: REMOVE DeployBlockerCash - this does not need to block the current App deploy since the fix is already in main and will ship in the next cycle.

    Detailed Analysis

    Evidence

    Timeline of events:

    Root cause:
    The frontend code in PR #79659 incorrectly told users to use * as the wildcard character for merchant matching. However, the backend (inherited from OldDot/Classic) expects . as the wildcard character. This was a frontend documentation/UX bug, not a backend logic bug.

    Verification

    I verified that:

    1. PR Expense rules phase 2 #79659 introduced the incorrect merchantHint text with * in all language files
    2. PR Update "use *" to "use ." #81177 corrected all language files to use . instead
    3. The current main branch code shows the correct hint
    4. PR Update "use *" to "use ." #81177 has been merged and is in main (merged on 2026-02-02)

    Root Cause

    This was a frontend UX bug where the hint text did not match the backend implementation:

    • Frontend (incorrect): Told users to type * for wildcard matching
    • Backend (correct): Expected . for wildcard matching (as used in OldDot/Classic)
    • Fix: Updated frontend hint text to match backend expectation

    The backend rule matching logic was working correctly all along - it just required the correct wildcard character that OldDot has always used.

    Current Status

    The issue is already resolved in the codebase. The fix (PR #81177) is merged to main and will be included in the next staging deploy. No further action is needed except to remove the deploy blocker label since this does not warrant blocking the current deploy.

  19. pecanoro commented on Feb 9, 2026

    @pecanoro
    Contributor

    Ok, Melvin didn't remove my label so that's good! Closing again

  20. OSBotify commented on Feb 9, 2026

    @OSBotify
    Contributor

    Update on Label Decision

    Per my investigation, this issue has been fixed in PR #81177 (merged to main on Feb 2). However, I am NOT removing the DeployBlockerCash label because:

    1. The label was re-added by @pecanoro (internal employee) on Feb 2 with the reasoning: "it's a feature that is not on production and we shouldn't deploy something that is not working"
    2. Per protocol, deploy blocker labels added by internal employees should not be automatically removed

    Context for decision makers:

    • The fix (PR Update "use *" to "use ." #81177) is already in main and will ship in the next deploy cycle
    • The original issue was caused by incorrect UI hint text (* vs .)
    • @JS00001 marked this as NAB (Not A Blocker) after the fix was merged
    • The feature works correctly when users follow the corrected hint text (use . instead of *)

    Recommendation: Internal team should decide whether to:

    • Keep the blocker and wait for PR Update "use *" to "use ." #81177 to be in staging before deploying
    • OR remove the blocker since the fix is already in main and the feature is new (N/A in production)
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 review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions