Skip to content

[Due for Payment] [$250] Workflow - Previous selection is cleared when selecting another member in "Expenses From" #74900

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: 9.2.54-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exp + https://test-management.browserstack.com/projects/2219752/test-runs/TR-1933/folder/13176709/41236911/1008199876?sort=-identifier
Email or phone of affected tester (no customers): applausetester+bm955@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Web, mweb, android
App Component: Workspace Settings

Action Performed:

Precondition -
Workspace is created, and two members are added

  1. Go to https://staging.new.expensify.com/
  2. Go to Workflow > Add approval Workflow
  3. On the Expenses From page, select one member > Next
  4. Select a different member on the Approver page
  5. Click on "Expenses From"
  6. Select any member that's not selected

Expected Result:

Previously selected members should remain selected, allowing multiple members to be checked at the same time

Actual Result:

When selecting another member, the previously selected checkbox becomes unchecked. However, after reselecting, multi-selection works again.

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/~021988652866434509115
  • Upwork Job ID: 1988652866434509115
  • Last Price Increase: 2025-11-12
Issue OwnerCurrent Issue Owner: @sakluger

Activity

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

    @melvin-bot

    Triggered auto assignment to @sakluger (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. nkdengineer commented on Nov 12, 2025

    @nkdengineer
    Contributor

    Proposal

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

    When selecting another member, the previously selected checkbox becomes unchecked. However, after reselecting, multi-selection works again.

    What is the root cause of that problem?

    We have two selectedMembers state which are not sync. One on WorkspaceWorkflowsApprovalsExpensesFromPage, one on ApproverSelectionList. Because selectedMembers is always empty array at the first time, the selectedMembers on WorkspaceWorkflowsApprovalsExpensesFromPage is wrong when the first time we select another member.

    const [selectedMembers, setSelectedMembers] = useState<SelectionListApprover[]>([]);

    onSelectApprover(newSelectedApprovers);

    const [selectedMembers, setSelectedMembers] = useState<SelectionListApprover[]>([]);

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

    We need to define initialSelectedMembers props in ApproverSelectionList and set it as initial value here

    const [selectedMembers, setSelectedMembers] = useState<SelectionListApprover[]>(initialSelectedMembers ?? []); 
    

    const [selectedMembers, setSelectedMembers] = useState<SelectionListApprover[]>([]);

    And then pass the initial selected member here

    const [selectedMembers, setSelectedMembers] = useState<SelectionListApprover[]>([]);

    What alternative solutions did you explore? (Optional)

    Instead of creating another state of selected member inside ApproverSelectionList, we can define it as a prop and pass it every time we use this component.

    const [selectedMembers, setSelectedMembers] = useState<SelectionListApprover[]>([]);

    Or we can calculate selectedMembers by filtering out allApprovers with isSelected field is true instead of saving it as a state in ApproverSelectionList

    const isAlreadySelected = selectedMembers.some((selectedOption) => selectedOption.login === member.login);

    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.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 12, 2025
  5. changed the title [-]Workflow - Previous selection is cleared when selecting another member in "Expenses From"[/-] [+][$250] Workflow - Previous selection is cleared when selecting another member in "Expenses From"[/+] on Nov 12, 2025
  6. melvin-bot commented on Nov 12, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 12, 2025
  8. melvin-bot commented on Nov 12, 2025

    @melvin-bot

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

  9. moved this to Bugs and Follow Up Issues in #expensify-bugson Nov 12, 2025
  10. abzokhattab commented on Nov 13, 2025

    @abzokhattab
    Contributor

    Thank you for the detailed proposals!

    Let’s move forward with the second option in the alternative proposal that @nkdengineer outlined, which derives selectedMembers from allApprovers by filtering on isSelected. It keeps the parent as the single source of truth and avoids the sync bug without using useEffect

    🎀 👀 🎀 C+ reviewed

  11. 26 remaining items

  12. nkdengineer commented on Dec 29, 2025

    @nkdengineer
    Contributor

    @sakluger The automation failed. Please process the payment here.

  13. abzokhattab commented on Jan 4, 2026

    @abzokhattab
    Contributor

    BugZero Checklist:

    • [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: https://github.com/Expensify/App/pull/72283/changes#r2659778864

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

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • Workspace is created, and two members are added

    Test:

    1. Go to Workflow > Add approval Workflow
    2. On the Expenses From page, select one member > Next
    3. Select a different member on the Approver page
    4. Click on "Expenses From"
    5. Select any member that's not selected
    6. Verify that the previously selected option is still selected

    Do we agree 👍 or 👎

  14. abzokhattab commented on Jan 4, 2026

    @abzokhattab
    Contributor

    the pipeline failed ... i think this should be due to payment

  15. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jan 7, 2026
  16. sakluger commented on Jan 7, 2026

    @sakluger
    Contributor

    Hey @abzokhattab and @nkdengineer - it looks like the original PR caused a regression, and I don't see the new PR linked here. Can you please post the newest PR that fixed this issue?

    Once I confirm the new PR, I will add the payment summary (with 50% reduction for the regression).

  17. changed the title [-][$250] Workflow - Previous selection is cleared when selecting another member in "Expenses From"[/-] [+][Due for Payment] [$250] Workflow - Previous selection is cleared when selecting another member in "Expenses From"[/+] on Jan 7, 2026
  18. abzokhattab commented on Jan 7, 2026

    @abzokhattab
    Contributor
  19. sakluger commented on Jan 8, 2026

    @sakluger
    Contributor

    Payment Summary

    Contributor: @nkdengineer $125 via NewDot
    Contributor+: @abzokhattab $125 via Newdot

  20. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Jan 8, 2026
  21. twisterdotcom commented on Jan 12, 2026

    @twisterdotcom
    Contributor

    @nkdengineer has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-16f9-aa70-8013-8f8fa771e414
  22. quinthar commented on Apr 13, 2026

    @quinthar
    Contributor

    Approved $125 to @abzokhattab

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