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
New Expensify displays the raw \: escape sequence in dependent-tag names containing a colon. #101426
Version Number: 9.4.81-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@Tmjarnesk1 Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Upload multilevel dependent tags with a tag name containing a colon.
Navigate to Workspace → Tags.
Open the dependent-tag list containing the project tags.
Locate a tag containing a colon and observe.
Expected Result:
The tag should display as Oakland, SanFransisco, consistent with Expensify Classic and the expense tag picker.
Actual Result:
The dependent-tag list displays the raw stored value as Oak\:land, San\:Fransisco. The backslash appears only on this page; it is not shown in Classic or when the tag is applied to an expense.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
The dependent-tag list renders the raw tag name instead of the unescaped one.
A literal colon inside a tag name is stored escaped as \:, because : is the multi-level tag delimiter. Every other surface unescapes it for display via getCleanedTagName. This one screen skips it when the policy has dependent tags:
name is display-only. The raw name is already preserved separately in value (:154) and keyForList (:153), which are what the lookups, selection and bulk actions use.
The conditional was introduced by Fix: Unable to import multi tags on Android and iOS & fix editing tags settings, in the same hunk as a genuinely needed keyForList change. Before that commit the page always cleaned the name, and neither the PR body nor the review discussion mentions the display change — it looks unintended.
What changes do you think we should make in order to solve the problem?
Always clean the display name on DynamicWorkspaceViewTagsPage.tsx:155 — drop the hasDependentTags ternary so name becomes getCleanedTagName(tag.name).
Leave keyForList (:153) and value (:154) raw. They are real identities feeding tagListKeyedByName, currentPolicyTag.tags[...], updateWorkspaceTagEnabled, deletePolicyTags and clearPolicyTagErrors. Cleaning either would break bulk enable/disable/delete for any tag with an escaped colon.
What alternative solutions did you explore? (Optional)
Cleaning the name inside the table row component instead of at the call site — rejected, because the row also receives already-cleaned names from WorkspaceTagsPage.tsx and would double-process.
Investigation details, side effects, and a related bug found nearby
Why cleaning name is safe.name has exactly four consumers, all display-side:
search — WorkspaceViewTagsTable/index.tsx:86-89, which tokenizes both nameandvalue, so cleaning only adds Oak:land to the matchable tokens while Oak\:land keeps matching
Selection is keyed purely on keyForList (selection.ts:82-91) and is disabled outright for dependent tags (:386). Row press uses the closed-over PolicyTag object, not the row (:162).
Expected side effects, both intended:
Sort position can shift for affected rows, since the sort now compares what the user actually sees.
getCleanedTagName also HTML-decodes, so a dependent tag stored as R&D starts rendering as R&D here — matching every other screen.
Ruled out: a dependent tag's name is only the leaf label, not a colon-joined path — the parent chain lives in rules.parentTagsFilter as a regex (PolicyTag.ts:20-33). So the \: here is unambiguously an escaped literal colon, not structural. parentTagsFilter itself is never rendered and must not be cleaned.
Where the escaping comes from: for this flow, the backend. importMultiLevelTags uploads the raw spreadsheet with no client-side escaping (Tag.ts:862-905); the server stores the escaped name. The App can't stop the escaping, so it must render it cleaned.
Separate bug found nearby, not fixed by the above. The tag list name is also rendered raw in ~10 places, because getTagListName returns the raw Onyx key. Most visibly, the header of this very screen (DynamicWorkspaceViewTagsPage.tsx:363) shows the raw value while line 339 cleans the identical value in the body. Others include DynamicIOURequestStepTag.tsx:208 and SearchEditMultiplePage.tsx:258. Note that currentTagListName doubles as the Onyx lookup key (:79), so the cleaned value must be a separate variable. This only shows up when a list name contains a colon, which the attached CSV doesn't exercise — worth a follow-up issue rather than scope creep here.
Verification: this is a deterministic rendering bug traced end to end in code; I did not run a live repro, since the reporter's screenshot already shows the raw value and the inconsistency is visible between two screens in the same file.
Related issue check: no duplicate found. Filtering Expenses by Tag Not Working touches tag matching but is about search filters returning no results, not name display.
💡 Suggested AI code review rule
This looks like a recurring, mechanically detectable pattern — the same class of raw-name leak exists in ~10 other places. Proposed for Expensify/App:
Rule:CONSISTENCY-18 — Render tag names through getCleanedTagName
Condition: Flag when a value originating from PolicyTag.name, getTagListName(...), or a policy-tag Onyx key is passed to a display prop (text, title, name, label, description, headerTitle, defaultValue) without getCleanedTagName. Do not flag identity uses — Onyx lookup keys, keyForList, value, route params, or parentTagsFilter.
Why:: is the multi-level tag delimiter, so a literal colon is stored as \:. Skipping the unescape leaks the raw escape sequence to users and makes screens disagree with each other, which is exactly this issue.
The full rule file, with the ❌/✅ code inline in App's coding-standards format, would go in App/.claude/skills/app-coding-standards/. If it's worth adding, a maintainer can open it there as a draft PR.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101426) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
When viewing multi-level dependent tags in Workspace > Tags, tag names containing a colon display the raw stored escape sequence (e.g., Oak\:land, San\:Fransisco) instead of the unescaped name (Oak:land, San:Fransisco).
What is the root cause of that problem?
In src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx (line 158), the table row data mapping conditionally suppresses cleaning tag names when dependent tags are enabled:
// src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx:155–165acc.push({keyForList: hasDependentTags ? `${tag.name}-${tag.rules?.parentTagsFilter??''}` : tag.name,value: tag.name,name: hasDependentTags ? tag.name : getCleanedTagName(tag.name),// ← Passes raw tag.name when hasDependentTags is true!enabled: tag.enabled,disabled: isDisabled,errors: tag.errors??undefined,pendingAction: tag.pendingAction,isLocked: !canWriteTags||isDisablingLastEnabledTag,showEnabledSwitch: !hasDependentTags,action: ()=>navigateToTagSettings(tag),});
Because : serves as the multi-level tag path delimiter, literal colons inside tag names are stored with an escape backslash (\:).
On regular (non-dependent) tags, line 158 runs getCleanedTagName(tag.name), which unescapes \: to : for display. However, the ternary hasDependentTags ? tag.name : getCleanedTagName(tag.name) deliberately passes the raw stored tag.name whenever hasDependentTags is true.
Consequently:
In dependent tag lists, name is passed as Oak\:land to the table row (WorkspaceTagsTableRow.tsx:98).
Internal tag identification (keyForList and value) correctly uses the raw string, but name (which is strictly used for user-facing text, accessibility labels, and sorting) incorrectly displays the unescaped backslash.
What changes do you think we should make in order to solve the problem?
In src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx, always wrap tag.name with getCleanedTagName for the display property name:
name is used solely for visual display and accessibility in WorkspaceTagsTableRow.tsx.
keyForList and value remain unchanged and raw, ensuring list keys, selection state, and tag actions (enable, disable, delete, navigate) continue to receive the exact stored identifier.
Tag list search in WorkspaceViewTagsTable/index.tsx tokenizes both name and value, so search matching continues to work for both cleaned and raw representations.
What alternative solutions did you explore? (Optional)
Cleaning inside WorkspaceTagsTableRow.tsx: Rejected because other callers (such as WorkspaceTagsPage.tsx) already pass cleaned names, which would lead to redundant processing. Cleaning at the property derivation site in DynamicWorkspaceViewTagsPage.tsx maintains consistency with the rest of the codebase.
Activity
MelvinBot commentedon Sep 17, 2026
Proposal
What is the root cause of that problem?
The dependent-tag list renders the raw tag name instead of the unescaped one.
A literal colon inside a tag name is stored escaped as
\:, because:is the multi-level tag delimiter. Every other surface unescapes it for display viagetCleanedTagName. This one screen skips it when the policy has dependent tags:src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx:155nameis display-only. The raw name is already preserved separately invalue(:154) andkeyForList(:153), which are what the lookups, selection and bulk actions use.This is why the escape leaks only here: the tag's own settings page (
DynamicTagSettingsPage.tsx:166), the expense tag picker (TagsOptionsListUtils.ts:65), the parent tags page (WorkspaceTagsPage.tsx:379) and Classic all clean the name.The conditional was introduced by Fix: Unable to import multi tags on Android and iOS & fix editing tags settings, in the same hunk as a genuinely needed
keyForListchange. Before that commit the page always cleaned the name, and neither the PR body nor the review discussion mentions the display change — it looks unintended.What changes do you think we should make in order to solve the problem?
Always clean the display name on
DynamicWorkspaceViewTagsPage.tsx:155— drop thehasDependentTagsternary sonamebecomesgetCleanedTagName(tag.name).Leave
keyForList(:153) andvalue(:154) raw. They are real identities feedingtagListKeyedByName,currentPolicyTag.tags[...],updateWorkspaceTagEnabled,deletePolicyTagsandclearPolicyTagErrors. Cleaning either would break bulk enable/disable/delete for any tag with an escaped colon.Add a test to
tests/ui/WorkspaceViewTagsTableTest.tsxcovering a dependent tag whose name contains\:, since no existing test exercises escaped colons.What alternative solutions did you explore? (Optional)
Cleaning the name inside the table row component instead of at the call site — rejected, because the row also receives already-cleaned names from
WorkspaceTagsPage.tsxand would double-process.Investigation details, side effects, and a related bug found nearby
Why cleaning
nameis safe.namehas exactly four consumers, all display-side:WorkspaceTagsTableRow.tsx:98WorkspaceTagsTableRow.tsx:61WorkspaceViewTagsTable/index.tsx:83WorkspaceViewTagsTable/index.tsx:86-89, which tokenizes bothnameandvalue, so cleaning only addsOak:landto the matchable tokens whileOak\:landkeeps matchingSelection is keyed purely on
keyForList(selection.ts:82-91) and is disabled outright for dependent tags (:386). Row press uses the closed-overPolicyTagobject, not the row (:162).Expected side effects, both intended:
getCleanedTagNamealso HTML-decodes, so a dependent tag stored asR&Dstarts rendering asR&Dhere — matching every other screen.Ruled out: a dependent tag's
nameis only the leaf label, not a colon-joined path — the parent chain lives inrules.parentTagsFilteras a regex (PolicyTag.ts:20-33). So the\:here is unambiguously an escaped literal colon, not structural.parentTagsFilteritself is never rendered and must not be cleaned.Where the escaping comes from: for this flow, the backend.
importMultiLevelTagsuploads the raw spreadsheet with no client-side escaping (Tag.ts:862-905); the server stores the escaped name. The App can't stop the escaping, so it must render it cleaned.Separate bug found nearby, not fixed by the above. The tag list name is also rendered raw in ~10 places, because
getTagListNamereturns the raw Onyx key. Most visibly, the header of this very screen (DynamicWorkspaceViewTagsPage.tsx:363) shows the raw value while line 339 cleans the identical value in the body. Others includeDynamicIOURequestStepTag.tsx:208andSearchEditMultiplePage.tsx:258. Note thatcurrentTagListNamedoubles as the Onyx lookup key (:79), so the cleaned value must be a separate variable. This only shows up when a list name contains a colon, which the attached CSV doesn't exercise — worth a follow-up issue rather than scope creep here.Verification: this is a deterministic rendering bug traced end to end in code; I did not run a live repro, since the reporter's screenshot already shows the raw value and the inconsistency is visible between two screens in the same file.
Related issue check: no duplicate found. Filtering Expenses by Tag Not Working touches tag matching but is about search filters returning no results, not name display.
💡 Suggested AI code review rule
This looks like a recurring, mechanically detectable pattern — the same class of raw-name leak exists in ~10 other places. Proposed for
Expensify/App:CONSISTENCY-18— Render tag names throughgetCleanedTagNamePolicyTag.name,getTagListName(...), or a policy-tag Onyx key is passed to a display prop (text,title,name,label,description,headerTitle,defaultValue) withoutgetCleanedTagName. Do not flag identity uses — Onyx lookup keys,keyForList,value, route params, orparentTagsFilter.:is the multi-level tag delimiter, so a literal colon is stored as\:. Skipping the unescape leaks the raw escape sequence to users and makes screens disagree with each other, which is exactly this issue.grep -nE '(text|title|name|label|description|headerTitle|defaultValue)=?\{?[^}]*(tag\.name|TagListName|tagListName)' src/DynamicWorkspaceViewTagsPage.tsx:155TagsOptionsListUtils.ts:63-72— cleaned for display, raw for key and searchThe full rule file, with the ❌/✅ code inline in App's coding-standards format, would go in
App/.claude/skills/app-coding-standards/. If it's worth adding, a maintainer can open it there as a draft PR.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101426)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (
External)melvin-bot commentedon Sep 17, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 22, 2026
@Ollyws Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Sep 24, 2026
@Ollyws 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Ollyws commentedon Sep 25, 2026
Will review asap.
ashusatyarthi-wq commentedon Sep 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing multi-level dependent tags in Workspace > Tags, tag names containing a colon display the raw stored escape sequence (e.g.,
Oak\:land, San\:Fransisco) instead of the unescaped name (Oak:land, San:Fransisco).What is the root cause of that problem?
In
src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx(line 158), the table row data mapping conditionally suppresses cleaning tag names when dependent tags are enabled:Because
:serves as the multi-level tag path delimiter, literal colons inside tag names are stored with an escape backslash (\:).On regular (non-dependent) tags, line 158 runs
getCleanedTagName(tag.name), which unescapes\:to:for display. However, the ternaryhasDependentTags ? tag.name : getCleanedTagName(tag.name)deliberately passes the raw storedtag.namewheneverhasDependentTagsistrue.Consequently:
nameis passed asOak\:landto the table row (WorkspaceTagsTableRow.tsx:98).keyForListandvalue) correctly uses the raw string, butname(which is strictly used for user-facing text, accessibility labels, and sorting) incorrectly displays the unescaped backslash.What changes do you think we should make in order to solve the problem?
In
src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx, always wraptag.namewithgetCleanedTagNamefor the display propertyname:Why this is safe:
nameis used solely for visual display and accessibility inWorkspaceTagsTableRow.tsx.keyForListandvalueremain unchanged and raw, ensuring list keys, selection state, and tag actions (enable, disable, delete, navigate) continue to receive the exact stored identifier.WorkspaceViewTagsTable/index.tsxtokenizes bothnameandvalue, so search matching continues to work for both cleaned and raw representations.What alternative solutions did you explore? (Optional)
WorkspaceTagsTableRow.tsx: Rejected because other callers (such asWorkspaceTagsPage.tsx) already pass cleaned names, which would lead to redundant processing. Cleaning at the property derivation site inDynamicWorkspaceViewTagsPage.tsxmaintains consistency with the rest of the codebase.ashusatyarthi-wq commentedon Sep 27, 2026
Compare branch: https://github.com/ashusatyarthi-wq/App/compare/fix/dependent-tag-escaped-colon-101426
fix: clean escaped colons in dependent tag names for display
Ollyws commentedon Sep 28, 2026
I couldn't reproduce this with the attached .csv, it renders the colons without the backslash:
@m-natarajan could you re-test? Thanks.
m-natarajan commentedon Sep 28, 2026
@Ollyws Unable to reproduce this in latest staging v9.4.94-0
Ollyws commentedon Sep 29, 2026
Ok I think we're good to close this then.
🎀👀🎀 C+ reviewed
melvin-bot commentedon Sep 29, 2026
Triggered auto assignment to @amyevans, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
amyevans commentedon Sep 29, 2026
Thanks for looking into it!