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 2025-09-12] [$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag #68263
Workspace has imported multi level independent tags
"Members must tag all expenses" is enabled in Tags > More > Settings
Mark all tag levels as Required (enable the toggle)
Go to staging.new.expensify.com
Go to workspace chat
Submit an expense and add all tag levels
Go to workspace settings > Tags
Click More > Import spreadsheet
Click Single level of tags
Click Switch Tag Levels
Close the RHP
Click Add tag
Add a tag
Go back to the transaction thread ini Step 3
Click Tag
Select the added single level tag in Step 9
Expected Result:
"no longer valid" violation should be dismissed after selecting a new tag
Actual Result:
"no longer valid" violation remains after switching tag level from multi to single and selecting a new tag
This is because the other tag level fields from the previous multi level tags are hidden now and the expense still has the previous multi level tags selected, but there is no way to deselect them
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidenceBug6913022_1754834129604.Screen_Recording_2025-08-10_at_21.43.22.mp4
Please re-state the problem that we are trying to solve in this issue.
"no longer valid" violation remains after switching tag level from multi to single and selecting a new tag
This is because the other tag level fields from the previous multi level tags are hidden now and the expense still has the previous multi level tags selected, but there is no way to deselect them
What is the root cause of that problem?
After selecting the multi level tags, the tags is A:B:C
Switching tag level cause hasMultipleTagLists is false
Select the new single tag (S), we update the tag by triggering insertTagIntoTransactionTagsString
to return the selected tag if policy?.hasMultipleTagLists is false
if (!policy?.hasMultipleTagLists) {
updatedTag = isSelectedTag ? '' : searchText;
} else {
// Independent tags (fallback): use comma-separated list
updatedTag = insertTagIntoTransactionTagsString(transactionTag, isSelectedTag ? '' : searchText, tagListIndex);
}
we also consider to early return tag if policy?.hasMultipleTagLists is false in insertTagIntoTransactionTagsString function
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update insertTagIntoTransactionTagsString to cover this case
What alternative solutions did you explore? (Optional)
We can use the condition here to detect if it's the single tag
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/-][+][$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/+]on Aug 12, 2025
Please re-state the problem that we are trying to solve in this issue.
After switching a workspace from multi-level independent tags to a single-level tag setup, selecting a new single-level tag does not dismiss the “Tag no longer valid” violation on existing expenses.
What is the root cause of that problem?
Transactions can retain colon-delimited multi-level tag values (e.g., “Level1:Level2:Level3”). Single-level validation was checking the full transaction.tag string, so hidden, previously selected deeper levels caused the out-of-policy violation to persist.
What changes do you think we should make in order to solve the problem?
changed the title [-][$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/-][+][Due for payment 2025-09-12] [$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/+]on Sep 5, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.1-20 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@grgia@twisterdotcom@s77rt / @nkdengineer The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[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: n/a
[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.
Bug requires regression test: Yes
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Aug 10, 2025
Triggered auto assignment to @twisterdotcom (
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.nkdengineer commentedon Aug 11, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
"no longer valid" violation remains after switching tag level from multi to single and selecting a new tag
This is because the other tag level fields from the previous multi level tags are hidden now and the expense still has the previous multi level tags selected, but there is no way to deselect them
What is the root cause of that problem?
A:B:ChasMultipleTagListsis falseinsertTagIntoTransactionTagsStringApp/src/pages/iou/request/step/IOURequestStepTag.tsx
Line 130 in 54e5acb
In this function, we inserts a newly selected tag into the already existing tags like a string
App/src/libs/IOUUtils.ts
Lines 167 to 176 in 54e5acb
but tagArray in this case is 'A:B:C' (old value), so the updated tag is
S:B:CS:B:Cis not in the policy so we don't update the violationApp/src/libs/Violations/ViolationsUtils.ts
Line 42 in 54e5acb
What changes do you think we should make in order to solve the problem?
We should update this logic
App/src/pages/iou/request/step/IOURequestStepTag.tsx
Line 130 in 54e5acb
to return the selected tag if
policy?.hasMultipleTagListsis falsewe also consider to early return tag if
policy?.hasMultipleTagListsis false ininsertTagIntoTransactionTagsStringfunctionWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update
insertTagIntoTransactionTagsStringto cover this caseWhat alternative solutions did you explore? (Optional)
We can use the condition here to detect if it's the single tag
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/-][+][$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/+]melvin-bot commentedon Aug 12, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021955357801454231388
melvin-bot commentedon Aug 12, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)mukhrr commentedon Aug 13, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
After switching a workspace from multi-level independent tags to a single-level tag setup, selecting a new single-level tag does not dismiss the “Tag no longer valid” violation on existing expenses.
What is the root cause of that problem?
Transactions can retain colon-delimited multi-level tag values (e.g., “Level1:Level2:Level3”). Single-level validation was checking the full
transaction.tagstring, so hidden, previously selected deeper levels caused the out-of-policy violation to persist.What changes do you think we should make in order to solve the problem?
We should update getTagViolationsForSingleLevelTags in
src/libs/Violations/ViolationsUtils.tsto validate only the first tag level:TransactionUtils.getTag(updatedTransaction, 0)to derive the selected single-level tag.And
updatedTransaction.tagshould be replaced byselectedTagin L33, L37, L42 and L52What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
Stripping trailing levels from
transaction.tagon policy change.s77rt commentedon Aug 14, 2025
@nkdengineer Thanks for the proposal. RCA makes sense and solution looks good to me.
🎀 👀 🎀 C+ reviewed
Link to proposal
10 remaining items
[-][$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/-][+][Due for payment 2025-09-12] [$250] Tags - "no longer valid" violation remains after switching tag level and selecting new tag[/+]melvin-bot commentedon Sep 5, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Sep 5, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.1-20 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-09-12. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Sep 5, 2025
@grgia @twisterdotcom @s77rt / @nkdengineer The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
s77rt commentedon Sep 7, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: Allow for multiple levels of tags on workspace #34983 (comment)
[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: n/a
[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.
Bug requires regression test: Yes
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/544921
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
twisterdotcom commentedon Sep 11, 2025
Payment Summary:
JmillsExpensify commentedon Sep 12, 2025
$250 approved for @s77rt