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 2025-05-14] [Due for payment 2025-05-14] [$250] AU - Room Invite - App auto-deselects all members after returning from member details page #59426
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
Version Number: v9.1.21-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/5857030 Issue reported by: Applause Internal Team Device used: Windows 10 / Chrome App Component: Workspace Settings
Action Performed:
Click 'FAB' > Start Chat > create a #Room
Complete the Room details > click Create Room
Click on the Room details in the new chat > Members > click Invite and
Invite several test accounts to the room
Click the Invite button again
Now select a couple of members, click on a single member outside the checkbox area
Verify the "Member Details" page opens
Return to the Invite page
Expected Result:
The app should retain all selected members after opening the member details page and returning.
Actual Result:
After selecting some members, opening the member details page, and returning, all selected members are deselected.
🚨 Edited by proposal-police: This proposal was edited at 2025-04-01 10:21:47 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After selecting some members, opening a member’s detail page, and then navigating back, all previously selected members are deselected.
What is the root cause of that problem?
This logic clears the selected options whenever the screen loses focus, which causes all selected members to be reset upon navigating away and returning.
What changes do you think we should make in order to solve the problem?
We should remove the logic that clears selected members on screen blur.
Instead, we should introduce logic to automatically update the selection only when a selected user has been removed from the room.
We already have similar logic in place for auto-updating selections in the WorkspaceCategoriesPage, which we can use as a reference and adapt for the RoomMembersPage.
Below is a basic example of the proposed change. The implementation details can be refined during the PR:
useEffect(()=>{if(selectedMembers.length===0||!canSelectMultiple){return;}setSelectedMembers((prevSelectedMembers)=>{constupdatedSelectedMembers=prevSelectedMembers.filter((accountID)=>{constisInParticipants=participants.includes(accountID);constpendingChatMember=reportMetadata?.pendingChatMembers?.findLast((member)=>member.accountID===accountID.toString(),);constisPendingDelete=pendingChatMember?.pendingAction===CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;// Keep the member only if they're still in the room and not pending removalreturnisInParticipants&&!isPendingDelete;});returnupdatedSelectedMembers;});},[participants,reportMetadata?.pendingChatMembers,canSelectMultiple,selectedMembers.length]);
We should apply the same approach across other pages to ensure consistency throughout the app.
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)
Please re-state the problem that we are trying to solve in this issue.
When a user is removed from a room via the RoomMemberDetailsPage, the selected members count in RoomMembersPage becomes incorrect because the selectedMembers state is not being updated to reflect the removed user.
What is the root cause of that problem?
The following code resets the selected members when screen is not focused.
It was added to handle the button count reset upon member deletion.
What changes do you think we should make in order to solve the problem?
Delete the above logic. Update the selected members' count, if they are deleted on the member's details page.
constparticipants=useMemo(()=>getParticipantsList(report,personalDetails,true),[report,personalDetails,isFocusedScreen]);useEffect(()=>{// Remove any selected members that are no longer in the participants listsetSelectedMembers((prevSelected)=>prevSelected.filter((selectedId)=>participants.includes(selectedId)));},[participants]);
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
App auto-deselects all members after returning from member details page
What is the root cause of that problem?
We set selectedMembers to an empty array when opening the room member details page, so when we navigate back, the selection is cleared. This behavior is confirmed in PR #48806
Expected Result on desktop: The dropdown button gets replaced with the green "+ Invite member" button and none of the members remain selected
Expected Result on mobile: The dropdown button "Selected" count is reset to 0 and none of the members remain selected. The mobile selection mode is still enabled.
Screen.Recording.2025-04-01.at.23.07.01.mp4
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.
@Expensify/design I'm cool with this change to persist the selection here? But I've noticed some inconsistencies, so wanted to double check ya'll are cool with this too? I.e Distance rates and Members table in workspace settings don't persist on selection, but Categories and Taxes do.
I think we should require a full sweep here through the app to make it consistent whichever way we go.
Yeah, I like the idea of making it persistent all over the app. We have the same on the reports page where you can multi-select, but open an expense and close again. I think that's the desired UX
@trjExpensify@dannymcclain I believe the behavior in the category page should serve as the source of truth for this implementation, as it offers several key advantages:
Selection persistence – The chosen categories remain intact even when users navigate away and return.
Automatic updates – If a selected category is deleted (by another device or an admin), the list updates accordingly.
In contrast, the current room member page behavior has limitations:
Selection reset – Selections are cleared whenever users navigate elsewhere.
No live updates – If a selected member is removed (by another device or admin), the changes aren’t reflected automatically.
@s77rt@trjExpensify@s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
changed the title [-][Due for payment 2025-05-14] [$250] AU - Room Invite - App auto-deselects all members after returning from member details page[/-][+][Due for payment 2025-05-14] [Due for payment 2025-05-14] [$250] AU - Room Invite - App auto-deselects all members after returning from member details page[/+]on May 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.41-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@s77rt@trjExpensify@s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[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: n/a
[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.
Bug requires regression test: No, given that this is coming from a testrail test already I don't think an explicit test is needed
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
Activity
melvin-bot commentedon Apr 1, 2025
Triggered auto assignment to @trjExpensify (
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.daledah commentedon Apr 1, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-01 10:21:47 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
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)
codewaseem commentedon Apr 1, 2025
Please re-state the problem that we are trying to solve in this issue.
When a user is removed from a room via the RoomMemberDetailsPage, the selected members count in RoomMembersPage becomes incorrect because the selectedMembers state is not being updated to reflect the removed user.
What is the root cause of that problem?
The following code resets the selected members when screen is not focused.
App/src/pages/RoomMembersPage.tsx
Lines 74 to 79 in e79a743
It was added to handle the button count reset upon member deletion.
What changes do you think we should make in order to solve the problem?
Delete the above logic. Update the selected members' count, if they are deleted on the member's details page.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
N/A
daledah commentedon Apr 1, 2025
Proposal updated
huult commentedon Apr 1, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
App auto-deselects all members after returning from member details page
What is the root cause of that problem?
We set
selectedMembersto an empty array when opening the room member details page, so when we navigate back, the selection is cleared. This behavior is confirmed in PR #48806App/src/pages/RoomMembersPage.tsx
Line 78 in d270267
What changes do you think we should make in order to solve the problem?
To resolve this issue, we just need to set
selectedMembersto an empty array when a member is deleted1 Remove this hook
App/src/pages/RoomMembersPage.tsx
Lines 74 to 79 in d270267
2 Add new logic to handle
selectedMembersto an empty arrayApp/src/pages/RoomMembersPage.tsx
Line 276 in d270267
add:
useEffect(() => { const shouldClearSelection = selectedMembers.some((accountID) => { const pendingChatMember = reportMetadata?.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString()); return pendingChatMember?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; }); if (shouldClearSelection) { setSelectedMembers([]); } }, [reportMetadata?.pendingChatMembers, selectedMembers]);expected of PR #48806
Screen.Recording.2025-04-01.at.23.07.01.mp4
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.
trjExpensify commentedon Apr 2, 2025
@Expensify/design I'm cool with this change to persist the selection here? But I've noticed some inconsistencies, so wanted to double check ya'll are cool with this too? I.e
Distance ratesandMemberstable in workspace settings don't persist on selection, butCategoriesandTaxesdo.I think we should require a full sweep here through the app to make it consistent whichever way we go.
dubielzyk-expensify commentedon Apr 2, 2025
Yeah, I like the idea of making it persistent all over the app. We have the same on the reports page where you can multi-select, but open an expense and close again. I think that's the desired UX
shawnborton commentedon Apr 2, 2025
Definitely agree with that, let's fix this and make it consistent everywhere.
dannymcclain commentedon Apr 2, 2025
+1 from me as well. Let's make it work the same everywhere.
huult commentedon Apr 2, 2025
@trjExpensify @dannymcclain When we remove a member, should we persist the selection or reset it as I proposed?
daledah commentedon Apr 2, 2025
@trjExpensify @dannymcclain I believe the behavior in the category page should serve as the source of truth for this implementation, as it offers several key advantages:
In contrast, the current room member page behavior has limitations:
dannymcclain commentedon Apr 2, 2025
Yeah I tend to agree with @daledah's suggestion of using categories as the source of truth.
@huult this is how categories currently works—is this helpful?
CleanShot.2025-04-02.at.11.29.59.mp4
cc @Expensify/design
37 remaining items
melvin-bot commentedon May 7, 2025
@s77rt @trjExpensify @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[-][Due for payment 2025-05-14] [$250] AU - Room Invite - App auto-deselects all members after returning from member details page[/-][+][Due for payment 2025-05-14] [Due for payment 2025-05-14] [$250] AU - Room Invite - App auto-deselects all members after returning from member details page[/+]melvin-bot commentedon May 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.41-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-05-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 7, 2025
@s77rt @trjExpensify @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
s77rt commentedon May 12, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: [CP Staging] Fix/48801 #48806 (comment)
[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: n/a
[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.
Bug requires regression test: No, given that this is coming from a testrail test already I don't think an explicit test is needed
trjExpensify commentedon May 14, 2025
Confirming there was one regression here?
s77rt commentedon May 14, 2025
@trjExpensify I think two
trjExpensify commentedon May 15, 2025
Okay cool, confirming payment as follows:
Thanks, closing!
JmillsExpensify commentedon May 22, 2025
$75 approved for @s77rt