Skip to content

[Due for payment 2026-11-10] [$175] Missing attendees violation is hidden when an approver views another member's expense #104596

Closed

Description

@MelvinBot

Problem

An approver or admin doesn't see the "Multiple attendees required for this category." violation on another member's expense. The expense creator does see it.

The backend leaves out the report owner when it counts attendees. The client check leaves out the current viewer instead. So when the approver views the expense, the client leaves out the approver, counts the creator as an extra attendee, and hides the violation.

Steps to reproduce

Preconditions: a Control workspace with attendee tracking on, and a category that requires attendees. Invite a member.

  1. As the member, create an expense in that category. Leave the member as the only attendee.
  2. As the member, go to Spend > Expenses. The expense shows the attendees violation.
  3. Log in as the admin or approver, or clear the cache if already logged in.
  4. Go to Spend > Expenses.

Expected: The member's expense shows the "Multiple attendees required for this category." violation.

Actual: The violation is hidden for the approver.

Reproducible on staging.

Creator Approver
Creator sees the violation Approver doesn't see the violation

Root cause

getIsMissingAttendeesViolation takes the viewer's personal details and leaves that person out of the attendee count (AttendeeUtils.ts:71-72).

The violation builder in ViolationsUtils already leaves out the report owner, with the current user as the fallback when the report isn't available (ViolationsUtils.ts:981-995). The two checks disagree whenever the viewer isn't the owner.

These callers pass the current user:

The confirmation page (useConfirmationValidation.ts) can keep the current user, because there the current user is the creator.

Suggested fix

Have getIsMissingAttendeesViolation and syncMissingAttendeesViolation leave out the report owner's login, like the backend does. Use the current user as the fallback for unreported expenses. Update every caller listed above.

Context

Found during review of Fix false missingAttendees violation in Search rows. See the review analysis and the screenshots.

The same problem was reported earlier in Attendee - Multiple attendee violation only applicable for the owner of the WS, which was closed in January 2026.

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit

Activity

  1. nkdengineer commented on Oct 21, 2026

    @nkdengineer
    Contributor

    @MelvinBot

    Let's update the image in the issue's description to be correct.

    • Approver
    Image
    • Creator
    Image
  2. MelvinBot commented on Oct 21, 2026

    @MelvinBot
    ContributorAuthor

    Done. I updated the Creator / Approver table in the issue description with your screenshots:

    • Creator: the mer expense shows "Multiple attendees required for this category."
    • Approver: the same mer expense from nkde243 shows no violation.

    The rest of the description is unchanged.


    view run

  3. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed on Oct 21, 2026
  4. MelvinBot commented on Oct 21, 2026

    @MelvinBot
    ContributorAuthor

    Proposal

    What is the root cause of that problem?

    The Spend > Expenses row rechecks the attendees violation on the client. The client check leaves out the viewer when it counts attendees, but the backend leaves out the report owner.

    When an approver views the member's expense, the client leaves out the approver. It then counts the creator as a real attendee and decides there's no violation. syncMissingAttendeesViolation then removes the backend's violation from the row.

    Code references

    These callers have the same mismatch but only add violations, so they can miss a client-added violation but can't hide a backend one:

    The two creation-flow callers, useConfirmationValidation.ts:276 and ViolationsUtils.ts:594 (via useFormErrorManagement), are correct as is, because there the current user is the creator.

    Fix false missingAttendees violation in Search rows only changed where attendees are read from. It didn't change who gets left out.

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

    1. In AttendeeUtils.ts, change getIsMissingAttendeesViolation and syncMissingAttendeesViolation to take the owner's login instead of the current user's personal details. Leave out attendees whose email matches that login, the same way ViolationsUtils does. If no login is available, use the same fallback: assume one attendee is the owner (attendees.length - 1).

    2. Pass the report owner's login, falling back to the current user's login for unreported expenses:

      • TransactionListItem: submitterLogin (this fixes the reported bug)
      • ExpenseReportListItem: submitterLogin
      • MoneyRequestView: iouReportOwnerLogin
    3. In useConfirmationValidation and getIsViolationFixed, pass the current user's login. Behavior there doesn't change.

    4. Add unit tests in tests/unit/AttendeeUtilsTest.ts:

      • The viewer isn't the owner and the owner is the only attendee: the violation shows, and sync keeps the backend violation.
      • The viewer isn't the owner and is the only attendee: no violation.

      Then update the existing getIsViolationFixed tests in ViolationUtilsTest.ts for the new argument.

    What alternative solutions did you explore? (Optional)

    Keep the current parameter type and have callers pass {...currentUserDetails, login: ownerLogin, email: ownerLogin}. This is a smaller diff, but it hides the intent, so changing the parameter is clearer.

    Related issues and open questions
    • Related: Fix false missingAttendees violation in Search rows. That issue fixed where Search rows read attendees from. This bug is about who gets left out.
    • If an approver doesn't have the owner's personal details loaded, submitterLogin is undefined. The row then falls back to the current user and the old behavior returns for that row.
    • I didn't reproduce this in the app. The issue's screenshots already show it, and the code path is clear.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104596) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

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

    @melvin-bot

    Current assignee @nkdengineer is eligible for the External assigner, not assigning anyone new.

  7. changed the title [-]Missing attendees violation is hidden when an approver views another member's expense[/-] [+][$175] Missing attendees violation is hidden when an approver views another member's expense[/+] on Oct 21, 2026
  8. 26 remaining items

  9. melvin-bot commented on Nov 7, 2026

    @melvin-bot
  10. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  12. nkdengineer commented on Nov 12, 2026

    @nkdengineer
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: https://github.com/Expensify/App/pull/79050/changes#r4547492545

    • [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.

    Regression Test Proposal

    Test:

    Preconditions: a Control workspace with attendee tracking on, and a category that requires attendees. Invite a member.

    1. As the member, create an expense in that category. Open the expense, go to Attendees and save it with only the member selected.
    2. As the member, go to Spend > Expenses. Verify the expense shows "Multiple attendees required for this category."
    3. Log in as the admin or approver or clear the cache if already logged in.
    4. Go to Spend > Expenses. Verify the member's expense also shows "Multiple attendees required for this category."
    5. As the membe, add a second attendee. Verify the violation is gone for both users.

    Do we agree 👍 or 👎

  13. melvin-bot commented on Nov 12, 2026

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. mallenexpensify commented on Nov 13, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    Ready. Job price: $175 (standard, no Help Wanted, assigned 2026-10-21).

    • nkdengineer (C+): 100%, via NewDot
    • VickyStash, rinej (agency): no payment

    No deploy blockers or regressions on the issue or the PR. Next: press Caps+Y, then pay.

    Evidence
    • C+ checklist, 5 test steps: comment
    • TestRail case: none yet
    • Resolving PR: #104855 by rinej, merged 2026-11-02, approved by nkdengineer, MariaHCD, mountiny. No revert.
    • Offending PR (from the checklist): #79050 by ikevin127, approved by JS00001, jayeshmangwani. No payee is on it.
    • Test videos: C+ 5/5. Author 0/5 platforms, before/after only.

    PAYPREP v1

  15. mallenexpensify commented on Nov 13, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @nkdengineer due $175 via NewDot

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