You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-07-28] Expense rule - Tag is not imported correctly when tag is in X: Y format #96391
Version Number: 9.4.36-0 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:#95105 Email or phone of affected tester (no customers):sidbhisdhidhisdhis@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Enable Rules and Tags.
Go to staging.new.expensify.com
Go to workspace settings > Rules.
Click More > Import merchant rules.
Upload a file that contains "Updated tag" in X: Y format.
→ Expense rule row shows X, Y instead of X: Y.
Open the expense rule.
→ Tag field shows X instead of X: Y.
Expected Result:
In Step 4, expense rule row should show the correct tag, which is X: Y.
In Step 5, Tag field will show X: Y.
Actual Result:
In Step 4, expense rule row shows X, Y instead of X: Y.
In Step 5, Tag field shows X instead of X: Y.
👋 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:
Identify the pull request that introduced this issue and revert it.
Multi-level tags in the app are encoded as levels joined by a bare colon with no spaces (X:Y) — that's exactly what the manual "Add tag" flow produces via trimTag(newTags.join(':')).
The new spreadsheet-import flow does not apply that normalization. ImportedMerchantRulesPage.tsx:176 reads the cell with only an outer .trim() and stores it raw at line 194, so a cell typed as X: Y is persisted verbatim (colon plus a space).
Every display path then splits that string on :, yielding ["X", " Y"] (note the leading space on the second level):
Rule detail shows only X — the edit page resolves each level against the policy's real tag lists; level 0 X matches, but level 1 " Y" (with the stray space) matches no real tag, so it's dropped.
The bug is not the display code — it's that the import stores a non-canonical tag string. X: Y was never meant to be a two-level tag; the space makes it one accidentally.
What changes do you think we should make in order to solve the problem?
Normalize the tag cell at import time so it matches the canonical encoding used everywhere else. In ImportedMerchantRulesPage.tsx, after reading the tag cell, split it on :, trim each level, and re-join with : — mirroring what AddTagPage.tsx:60 already does (trimTag + getTagArrayFromName keep escaped-colon handling consistent). X: Y then becomes the valid X:Y, and both the row and the detail render X: Y correctly.
Notes / edge cases
Follow the same escaping rules as trimTag/getTagArrayFromName so a single-level tag whose name legitimately contains a colon stays escaped (\:), keeping import and manual creation in sync.
This is a new, staging-only feature, so no data migration for previously-imported rules is needed.
Fix is entirely client-side in Expensify/App.
Confidence: High — verified both display symptoms against the code paths and confirmed the canonical join(':') (no space) encoding vs. the raw import store.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/96391) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
@gleitebr X: Y denotes it is a multi level tag. So expectation of the issue looks incorrect to me. The issue here is of not trimming multi-level tags(X: Y) value with (X:Y) while importing the rule, which ends up with an incorrect value for the child tags(bcoz of the extra space).
Activity
applause-bot commentedon Jul 17, 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/ae68014242c61a1db7b5ee3fe52be4a104a0e305986de3f4e9c80f34688e3cae
https://platform.applause.com/services/links/v1/external/5f5c7b0f9dafd6360b5e3044b43a0e0866dc7d750b52c71fa1ea4dd3918af7e5
melvin-bot commentedon Jul 17, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #95105
melvin-bot commentedon Jul 17, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 17, 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 Jul 17, 2026
Proposal
What is the root cause of that problem?
Multi-level tags in the app are encoded as levels joined by a bare colon with no spaces (
X:Y) — that's exactly what the manual "Add tag" flow produces viatrimTag(newTags.join(':')).The new spreadsheet-import flow does not apply that normalization.
ImportedMerchantRulesPage.tsx:176reads the cell with only an outer.trim()and stores it raw at line 194, so a cell typed asX: Yis persisted verbatim (colon plus a space).Every display path then splits that string on
:, yielding["X", " Y"](note the leading space on the second level):X, Y—MerchantRulesSection.tsx:61rendersgetCommaSeparatedTagNameWithSanitizedColons(rule.tag), which splits on:and joins with,(PolicyUtils.ts:1190).X— the edit page resolves each level against the policy's real tag lists; level 0Xmatches, but level 1" Y"(with the stray space) matches no real tag, so it's dropped.The bug is not the display code — it's that the import stores a non-canonical tag string.
X: Ywas never meant to be a two-level tag; the space makes it one accidentally.What changes do you think we should make in order to solve the problem?
Normalize the tag cell at import time so it matches the canonical encoding used everywhere else. In
ImportedMerchantRulesPage.tsx, after reading the tag cell, split it on:, trim each level, and re-join with:— mirroring whatAddTagPage.tsx:60already does (trimTag+getTagArrayFromNamekeep escaped-colon handling consistent).X: Ythen becomes the validX:Y, and both the row and the detail renderX: Ycorrectly.Notes / edge cases
trimTag/getTagArrayFromNameso a single-level tag whose name legitimately contains a colon stays escaped (\:), keeping import and manual creation in sync.setPolicyCodingRuleinsrc/libs/actions/Policy/Rules.tsdoesn't re-mangle the value.Expensify/App.Confidence: High — verified both display symptoms against the code paths and confirmed the canonical
join(':')(no space) encoding vs. the raw import store.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/96391)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
NicolasBonet commentedon Jul 17, 2026
@MelvinBot implement that
MelvinBot commentedon Jul 17, 2026
🤖 Draft PR created: #96407
Please mark it as "Ready for review" when it is ready for review.
Pujan92 commentedon Jul 17, 2026
@gleitebr X: Y denotes it is a multi level tag. So expectation of the issue looks incorrect to me. The issue here is of not trimming multi-level tags(X: Y) value with (X:Y) while importing the rule, which ends up with an incorrect value for the child tags(bcoz of the extra space).
@NicolasBonet @truph01
Issue:
Screen.Recording.2026-07-17.at.22.42.01.mov
Melvin PR fixes this issue which looks good to me.
Screen.Recording.2026-07-17.at.22.44.44.mov
31 remaining items
NicolasBonet commentedon Jul 22, 2026
@Pujan92 let's add the checklist please so we can proceed with closing
Pujan92 commentedon Jul 22, 2026
Regression Test Proposal
melvin-bot commentedon Jul 27, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 27, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jul 30, 2026
Payment Summary
Contributor+: @Pujan92 due $250 via NewDot
twisterdotcom commentedon Aug 4, 2026
$250 approved for @Pujan92 in Report ID: R00KnehTMFam.
Zapier Logs
Run ID: 00040eee-02c9-a25f-bf89-200111ffbee4SO: https://stackoverflowteams.com/c/expensify/questions/7582