Skip to content

[$250] Workflows - Blank row appears after deselecting submitter #83251

Closed

Description

@mitarachim

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: 9.3.25-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #82841
Email or phone of affected tester (no customers): jsodjsodnjoisjdosij@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Invite user A to the workspace.
  • Create a new workflow when user A submits to user A.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Workflows.
  3. Click on the custom workflow where user A submits to user A.
  4. Click Expenses from.
  5. Deselect user A.

Expected Result:

No blank row will appear after deselecting the submitter.

Actual Result:

Blank row appears after deselecting the submitter.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7086425_1771884488009.7.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @shubham1206agra
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022026061231398885256
  • Upwork Job ID: 2026061231398885256
  • Last Price Increase: 2026-02-23

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Feb 23, 2026
  2. melvin-bot commented on Feb 23, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #82841

  3. melvin-bot commented on Feb 23, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. melvin-bot commented on Feb 23, 2026

    @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.

  5. github-actions commented on Feb 23, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. OSBotify commented on Feb 23, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #82841 - "Fix approval workflow member selection to include all workspace members" by @Beamanator (High confidence)
    Related Issues: https://github.com/Expensify/Expensify/issues/598876

    Recommendation: REVERT

    This PR changed how availableMembers are built in WorkflowUtils.ts, switching from deriving members from workflows to including ALL workspace members. While this fixed the original issue (members in custom workflows not appearing), it introduced a new bug where blank rows appear after deselecting submitters. Reverting this PR will allow time to implement a proper fix that handles all edge cases.

    Labels: No label changes needed - this is a Frontend bug affecting App deploy, so DeployBlockerCash should remain.

    📋 Detailed Analysis

    Evidence

    Verification

    • PR Fix approval workflow member selection to include all workspace members #82841 modifies src/libs/WorkflowUtils.ts - the file responsible for building approval workflows and available members
    • The PR changed the logic in convertPolicyEmployeesToApprovalWorkflows() to build availableMembers from all employees in the loop, rather than deriving it from workflow members
    • The affected page (WorkspaceWorkflowsApprovalsExpensesFromPage.tsx) uses approvalWorkflow.availableMembers to populate the member selection list

    Root Cause

    The PR changed availableMembers from being derived from workflow members to including ALL workspace members. The new logic builds availableMembers in the employee loop:

    for (const employee of Object.values(employees)) {
        const {email, submitsTo, pendingAction} = employee;
        if (!email) {
            continue;
        }
        const member = buildMemberFromEmployee(employee, personalDetailsByEmail, email);
        if (pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
            availableMembers.push(member);
        }
        // ... rest of workflow assignment logic
    }

    When a user deselects a submitter (especially in self-approval scenarios like "user A submits to user A"), the filtering/mapping logic in WorkspaceWorkflowsApprovalsExpensesFromPage.tsx appears to create entries with missing or undefined properties, resulting in blank rows. This suggests an edge case was not handled when expanding availableMembers to include all workspace members.

    The specific edge case likely involves:

    1. Members with self-approval configurations (submitsTo equals own email)
    2. The interaction between selectedMembers state and availableMembers filtering when toggling selections
    3. Potential data mapping issues when personal details are missing for certain members
  7. 8 remaining items

  8. melvin-bot commented on Feb 23, 2026

    @melvin-bot
  9. shubham1206agra commented on Feb 24, 2026

    @shubham1206agra
    Contributor

    @Beamanator Can you please take over this issue?

  10. yuvrajangadsingh commented on Feb 24, 2026

    @yuvrajangadsingh
    Contributor

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

    after deselecting a submitter in Workflows > Expenses from, a blank row appears in the list.

    What is the root cause of that problem?

    PR #82841 changed convertPolicyEmployeesToApprovalWorkflows in WorkflowUtils.ts so that availableMembers now contains ALL workspace employees (previously it was just the first workflow's members). this was correct — it fixed members in custom workflows not appearing in the picker.

    but in WorkspaceWorkflowsApprovalsEditPage.tsx (line ~120), the useEffect sets:

    availableMembers: [...currentApprovalWorkflow.members, ...defaultWorkflowMembers]
    

    since defaultWorkflowMembers (which is result.availableMembers) now includes ALL employees, and currentApprovalWorkflow.members is a subset of that, every current workflow member appears twice. while a member is selected, both duplicates get filtered out and replaced by the selected entry — looks fine. when you deselect, both duplicates pass the filter and get pushed into the list. duplicate keyForList values cause React/FlashList to render one as a blank row.

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

    in src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsEditPage.tsx, deduplicate when building availableMembers:

    // before (creates duplicates):
    availableMembers: [...currentApprovalWorkflow.members, ...defaultWorkflowMembers],
    
    // after:
    availableMembers: [
        ...currentApprovalWorkflow.members,
        ...defaultWorkflowMembers.filter(
            (m) => !currentApprovalWorkflow.members.some((wm) => wm.email === m.email)
        ),
    ],

    this preserves the PR #82841 fix (all workspace members in the picker) while preventing the duplicate entries that cause the blank row. one-line change, fixes it at the source rather than downstream in ExpensesFromPage.

  11. self-assigned this
    on Feb 24, 2026
  12. Beamanator commented on Feb 24, 2026

    @Beamanator
    Contributor

    Looking!!

  13. added
    ReviewingHas a PR in review
    and removed
    Help WantedApply this label when an issue is open to proposals by contributors
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 24, 2026
  14. Beamanator commented on Feb 24, 2026

    @Beamanator
    Contributor

    Fixed merged and CP'd, getting retested

  15. m-natarajan commented on Feb 24, 2026

    @m-natarajan

    Passed, Chrome / v9.3.25-9

    Screen.Recording.2026-02-24.at.20.58.17.1.mp4
  16. Beamanator commented on Feb 24, 2026

    @Beamanator
    Contributor

    Nice! closing time!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions