Skip to content

[Due for payment 2025-12-02][$250] Tags - Missing tag violation doesn't show tag name in error #73417

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: V9.2.37-8
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #40741
Email or phone of affected tester (no customers): Slottwo1 fgg55@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13
App Component: Workspace Settings

Action Performed:

  1. Launch app
  2. Go to workspace settings
  3. Enable tags
  4. Set tag a custom name
  5. Enable members must tag all expenses
  6. Go to workspace chat
  7. Create a manual expense without tag

Expected Result:

Missing tag violation must show tag name in error.

Actual Result:

Missing tag violation doesn't show tag name in error.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021981723294903105744
  • Upwork Job ID: 1981723294903105744
  • Last Price Increase: 2025-10-31
Issue OwnerCurrent Issue Owner: @NicMendonca

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 24, 2025
  2. melvin-bot commented on Oct 24, 2025

    @melvin-bot

    Triggered auto assignment to @NicMendonca (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.

  3. mohammadjafarinejad commented on Oct 24, 2025

    @mohammadjafarinejad
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Missing tag violation doesn't show tag name in error.

    What is the root cause of that problem?

    The bug is in the getTagViolationsForSingleLevelTags function.
    When creating a missing tag violation for single-level tags, the code doesn't include the tagName in the violation's data object:

    // Add 'missingTag violation' if tag is required and not set
    if (!hasMissingTagViolation && !updatedTransaction.tag && policyRequiresTags) {
    newTransactionViolations.push({name: CONST.VIOLATIONS.MISSING_TAG, type: CONST.VIOLATION_TYPES.VIOLATION});
    }

    The violation is created without the data: {tagName: ...} field, which causes the translation function to fall back to the generic "tag" text.

    For comparison, the code correctly handles this for dependent tags (multi-level):

    function getTagViolationsForDependentTags(policyTagList: PolicyTagLists, transactionViolations: TransactionViolation[], tagName: string) {
    const tagViolations = [...transactionViolations];
    if (!tagName) {
    Object.values(policyTagList).forEach((tagList) =>
    tagViolations.push({
    name: CONST.VIOLATIONS.MISSING_TAG,
    type: CONST.VIOLATION_TYPES.VIOLATION,
    data: {tagName: tagList.name},
    }),

    The translation function expects a tagName parameter. When tagName is undefined, it falls back to the generic "Missing tag".

    missingTag: ({tagName}: ViolationsMissingTagParams = {}) => `Missing ${tagName ?? 'tag'}`,

    What changes do you think we should make in order to solve the problem?

    Add the tagName to the violation data when creating missing tag violations for single-level tags, matching the pattern used for multi-level tags. We should fix all places where we need to pass tagName, like:

    // Add 'missingTag violation' if tag is required and not set
    if (!hasMissingTagViolation && !updatedTransaction.tag && policyRequiresTags) {
    newTransactionViolations.push({name: CONST.VIOLATIONS.MISSING_TAG, type: CONST.VIOLATION_TYPES.VIOLATION});
    }

    // Add 'tagOutOfPolicy' violation if tag is not in policy
    if (!hasTagOutOfPolicyViolation && updatedTransaction.tag && !isTagInPolicy) {
    newTransactionViolations.push({name: CONST.VIOLATIONS.TAG_OUT_OF_POLICY, type: CONST.VIOLATION_TYPES.VIOLATION});
    }

    Example:

    if (!hasMissingTagViolation && !updatedTransaction.tag && policyRequiresTags) {
        const tagName = policyTagList[policyTagListName]?.name;
        newTransactionViolations.push({
            name: CONST.VIOLATIONS.MISSING_TAG, 
            type: CONST.VIOLATION_TYPES.VIOLATION,
            data: {tagName}
        });
    }
    • We should also fix the backend.
    Image

    What alternative solutions did you explore? (Optional)

    None

  4. daledah commented on Oct 24, 2025

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Missing tag violation doesn't show tag name in error.

    What is the root cause of that problem?

    We don't add the tagName data here

    // Add 'missingTag violation' if tag is required and not set
    if (!hasMissingTagViolation && !updatedTransaction.tag && policyRequiresTags) {
    newTransactionViolations.push({name: CONST.VIOLATIONS.MISSING_TAG, type: CONST.VIOLATION_TYPES.VIOLATION});
    }

    What changes do you think we should make in order to solve the problem?

    1. We should add tagName as policyTagListName
        // Add 'missingTag violation' if tag is required and not set
        if (!hasMissingTagViolation && !updatedTransaction.tag && policyRequiresTags) {
            newTransactionViolations.push({name: CONST.VIOLATIONS.MISSING_TAG, type: CONST.VIOLATION_TYPES.VIOLATION, data: {tagName: policyTagListName}});
        }
    
    1. Then we also need to update the Back End UpdateMoneyRequestTag API to return Tag name in data in transaction violations
    Image

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    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.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 24, 2025
  6. melvin-bot commented on Oct 24, 2025

    @melvin-bot
  7. changed the title [-]Tags - Missing tag violation doesn't show tag name in error[/-] [+][$250] Tags - Missing tag violation doesn't show tag name in error[/+] on Oct 24, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 24, 2025
  9. melvin-bot commented on Oct 24, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  10. eVoloshchak commented on Oct 27, 2025

    @eVoloshchak
    Contributor

    @mohammadjafarinejad's proposal looks good to me!

    🎀👀🎀 C+ reviewed!

  11. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    Triggered auto assignment to @amyevans, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  12. 49 remaining items

  13. stephanieelliott commented on Dec 17, 2025

    @stephanieelliott
    Contributor

    Payment Summary

  14. mohammadjafarinejad commented on Dec 18, 2025

    @mohammadjafarinejad
    Contributor

    @stephanieelliott Accepted. Thanks!

  15. stephanieelliott commented on Dec 18, 2025

    @stephanieelliott
    Contributor

    All paid up, thanks!

  16. eVoloshchak commented on Dec 18, 2025

    @eVoloshchak
    Contributor

    @stephanieelliott, I'm also owed payment for review of #74152

  17. melvin-bot commented on Dec 26, 2025

    @melvin-bot

    @amyevans, @eVoloshchak, @rushatgabhane, @stephanieelliott, @mohammadjafarinejad Whoops! This issue is 2 days overdue. Let's get this updated quick!

  18. stephanieelliott commented on Dec 31, 2025

    @stephanieelliott
    Contributor

    Oops, sorry @eVoloshchak! Updated the payment summary to show your're owed $250 via NewDot

  19. trjExpensify commented on Jan 13, 2026

    @trjExpensify
    Contributor

    $250 approved for @eVoloshchak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions