Repository navigation
Description
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.90-2
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: #89561
Email or phone of affected tester (no customers): applausetester+ssndjois2jd1@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests
Action Performed:
Precondition:
- Enable Rules and Expensify Card.
- Workspace has at least one Expensify card.
- Go to staging.new.expensify.com
- Go to workspace settings > Rules.
- Click Add spend rule.
- Create a spend rule with one spend category.
- Open the created rule.
- Edit Spend category and include all spend categories.
- Click Save rule.
- Go to #admins.
- Open the system message for the edit in Step 6.
Expected Result:
"Spend category" will not appear for each spend category in the system message.
Actual Result:
"Spend category" appears for each spend category in the system message.
added allowed spend category 'Alcohol and bars', spend category 'Amazon and bookstores', spend category 'Automotive', spend category 'Car rentals', spend category 'Dining', spend category 'Fuel and gas', spend category 'Government and non-profits', spend category 'Groceries', spend category 'Gyms and fitness', spend category 'Healthcare', spend category 'Hotels', spend category 'Internet and phone', spend category 'Office supplies', spend category 'Parking and tolls', spend category 'Professional services', spend category 'Retail', spend category 'Shipping and delivery', spend category 'Software', spend category 'Transit and rideshare', and spend category 'Travel agencies' on 'mmmoo'
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7168811_1780331696738.9.mp4
Applause Internal Information
Exported by: Vincenzo Godoy
Bug ID: 7168811
Issue Owner
Current Issue Owner: @mallenexpensifyMetadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Jun 1, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/8b6e0d85b02034e173b3bebc04084e1d36c5a05d288552b1c0e640c3a17873a6
melvin-bot commentedon Jun 1, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #89561
melvin-bot commentedon Jun 1, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 1, 2026
👋 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:
MelvinBot commentedon Jun 1, 2026
Proposal
What is the root cause of that problem?
When a spend rule edit adds multiple spend categories at once, the system message is built by emitting one phrase per category and then joining them. The join logic only de-duplicates the repeated adjective ("allowed"), not the repeated noun ("spend category"), so "spend category" is printed before every value.
Trace for the reported flow (rule edited to allow ~20 categories):
getDiffPhrasescreates oneaddedphrase per category. Each phrase's body comes frombodySpendCategory, which always rendersspend category '<value>'.joinSpendRulePhraseskeeps the full body on the first phrase and, for the rest, only swapsbodyWithAdjective→bodyWithoutAdjective. Both variants still contain the words "spend category" — there is no "value-only" variant — so the noun repeats.This produces exactly the reported string:
added allowed spend category 'Alcohol and bars', spend category 'Amazon and bookstores', ….Why it matches, and scope
actionVerb.allow=allowed, so phrase 1 =added+allowed spend category 'Alcohol and bars'; phrases 2..N reusebodyWithoutAdjective=spend category '<value>';formatListjoins them andcomposeOnCardsappendson 'mmmoo'.The same latent bug applies to merchants (
bodyMerchant) — adding multiple merchants would readmerchant 'A', merchant 'B', …. This is purely a client-side display formatting bug inApp; the backend just sends the category list.What changes do you think we should make in order to solve the problem?
Make a repeated noun collapse to just the quoted value for consecutive phrases of the same kind. Concretely, in
SpendRuleChangeLogUtils.ts:SpendRulePhraseanoundiscriminator (e.g.'merchant' | 'spendCategory' | '') and a value-only body (e.g.'Amazon and bookstores'), populated ingetDiffPhrases.joinSpendRulePhrases, when the current phrase'snounmatches the previously-appended phrase'snoun, push the value-only body instead ofbodyWithoutAdjective.Result:
added allowed spend category 'Alcohol and bars', 'Amazon and bookstores', … and 'Travel agencies' on 'mmmoo'— and the same fix covers merchants.What alternative solutions did you explore? (Optional)
In
getDiffPhrases, collapse multiple added/removed values of the same kind into a single phrase whose body lists all values (e.g.allowed spend category 'A', 'B', 'C'). Cleaner output, but needs a value-list string that doesn't re-wrap each value in quotes.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92295)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
luacmartins commentedon Jun 1, 2026
NAB this feature is staging only
14 remaining items
melvin-bot commentedon Jun 15, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)FitseTLT commentedon Jun 16, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment:https://github.com/Expensify/App/pull/89561/changes#r3421072488
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Jun 19, 2026
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.
FitseTLT commentedon Jun 19, 2026
False alarm
melvin-bot commentedon Jun 21, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jun 22, 2026
Payment Summary
Contributor+: @FitseTLT due $250 via NewDot
^ Test case created. Thx
m-natarajan commentedon Jun 22, 2026
@FitseTLT Spend category not displayed in Edit rule. Tried both expensifail account and public doamin as well. Is this an issue or option N/A?
flaviadefaria commentedon Jul 31, 2026
Approved: @FitseTLT due $250 via NewDot