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] [$250] Workflow - Previous selection is cleared when selecting another member in "Expenses From" #74900
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.
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.
Or we can calculate selectedMembers by filtering out allApprovers with isSelected field is true instead of saving it as a state in ApproverSelectionList
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 [-]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
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
[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:
Go to Workflow > Add approval Workflow
On the Expenses From page, select one member > Next
Select a different member on the Approver page
Click on "Expenses From"
Select any member that's not selected
Verify that the previously selected option is still selected
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).
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
Activity
melvin-bot commentedon Nov 12, 2025
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.nkdengineer commentedon Nov 12, 2025
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
selectedMembersstate which are not sync. One onWorkspaceWorkflowsApprovalsExpensesFromPage, one onApproverSelectionList. BecauseselectedMembersis always empty array at the first time, theselectedMembersonWorkspaceWorkflowsApprovalsExpensesFromPageis wrong when the first time we select another member.App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx
Line 39 in 82a45ab
App/src/components/ApproverSelectionList.tsx
Line 121 in 82a45ab
App/src/components/ApproverSelectionList.tsx
Line 86 in 82a45ab
What changes do you think we should make in order to solve the problem?
We need to define
initialSelectedMembersprops inApproverSelectionListand set it as initial value hereApp/src/components/ApproverSelectionList.tsx
Line 86 in 82a45ab
And then pass the initial selected member here
App/src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsExpensesFromPage.tsx
Line 39 in 82a45ab
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.App/src/components/ApproverSelectionList.tsx
Line 86 in 82a45ab
Or we can calculate
selectedMembersby filtering outallApproverswithisSelectedfield istrueinstead of saving it as a state inApproverSelectionListApp/src/components/ApproverSelectionList.tsx
Line 110 in 82a45ab
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.
[-]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"[/+]melvin-bot commentedon Nov 12, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021988652866434509115
melvin-bot commentedon Nov 12, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (
External)abzokhattab commentedon Nov 13, 2025
Thank you for the detailed proposals!
Let’s move forward with the second option in the alternative proposal that @nkdengineer outlined, which derives
selectedMembersfromallApproversby filtering onisSelected. It keeps the parent as the single source of truth and avoids the sync bug without usinguseEffect🎀 👀 🎀 C+ reviewed
26 remaining items
nkdengineer commentedon Dec 29, 2025
@sakluger The automation failed. Please process the payment here.
abzokhattab commentedon Jan 4, 2026
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:
Test:
Do we agree 👍 or 👎
abzokhattab commentedon Jan 4, 2026
the pipeline failed ... i think this should be due to payment
sakluger commentedon Jan 7, 2026
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).
[-][$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"[/+]abzokhattab commentedon Jan 7, 2026
sakluger commentedon Jan 8, 2026
Payment Summary
Contributor: @nkdengineer $125 via NewDot
Contributor+: @abzokhattab $125 via Newdot
twisterdotcom commentedon Jan 12, 2026
@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-8f8fa771e414quinthar commentedon Apr 13, 2026
Approved $125 to @abzokhattab