Repository navigation
Description
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.43-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: #72871
Email or phone of affected tester (no customers): poipio514+employee1@gmail.com
Issue reported by: Applause Internal Team
Device used: Windows 11 / Chrome, iPhone 13 / Safari
App Component: Money Requests
Action Performed:
Preconditions:
- Login with any account that has an invited workspace
- Delete all existing workspaces and leave from any invited workspace, so there will be a "you have no workspace" modal displayed in workspace tab.
Steps:
- Refresh the page
- Click FAB > Click "create expense"
- Enter any amount > click "next"
- Observe the recipient list -> there's a deleted workspace displayed
- Click on the workspace
- Enter the merchant and click "create ... expense"
Expected Result:
The deleted workspace shouldn't be visible in recipient list, like in mobile app version do. Also, if user click on the deleted expense as recipient, it should be trigger an error.
Actual Result:
The deleted expense is visible in recipient list and when user try to select it as recipient, user is navigated to self DM and the expense is created in self DM.
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
Bug6993491_1762245743401.deleted_workspace.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021985812442777928560
- Upwork Job ID: 1985812442777928560
- Last Price Increase: 2025-11-11
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Nov 4, 2025
Triggered auto assignment to @Christinadobrzyn (
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.mitarachim commentedon Nov 4, 2025
Issue was found while executing QA for PR #72871
abbasifaizan70 commentedon Nov 4, 2025
Please re-state the problem that we are trying to solve in this issue.
When creating an expense, deleted workspaces are still appearing in the recipient list. When a user selects a deleted workspace as a recipient, they are navigated to their self DM and the expense is created there instead of showing an error.
Expected Result:
Actual Result:
What is the root cause of that problem?
The
isValidReportfunction insrc/libs/OptionsListUtils/index.tsdoesn't check if a policy expense chat's associated policy is deleted or pending deletion. When a workspace is deleted, its policy getspendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, but the expense chat reports associated with that policy can still exist in the reports collection. The validation logic filters based on report properties but doesn't validate the policy status.The
shouldShowPolicyutility function exists to check if a policy should be displayed (excluding deleted policies whenshouldShowPendingDeletePolicyisfalse), but it's not being used in theisValidReportfunction when validating policy expense chats.What changes do you think we should make to solve the problem?
Add a check in the
isValidReportfunction to filter out policy expense chats whose associated policies are deleted or pending deletion. This will ensure deleted workspaces don't appear in the recipient list, matching the mobile app behavior.Changes Made
File:
src/libs/OptionsListUtils/index.tsshouldShowPolicyto the imports from@libs/PolicyUtilsisValidReportfunction to check if policy expense chat's policy is deletedWhat alternative solutions did you explore? (Optional)
Filter at the report level: Checked if we could filter deleted policies when building the reports list, but the filtering needs to happen at the option validation level since reports can exist independently of their policy status.
Validation in MoneyRequestParticipantsSelector: Considered adding validation in the component, but the proper place is in
isValidReportsince this ensures deleted workspaces don't appear in any recipient selection scenario, not just expense creation.Using
isPendingDeletePolicydirectly: Instead ofshouldShowPolicy, we could checkpolicy?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, butshouldShowPolicyprovides a more comprehensive check that also handles edge cases like policies with errors.Christinadobrzyn commentedon Nov 4, 2025
@lakchote @ZhenjaHorbach @LukasMod It looks like this was found while executing the QA of #72871
Does that mean that you should work on the fix? I don't think that necessarily means a regression, correct?
ZhenjaHorbach commentedon Nov 4, 2025
I don't think this is an issue with our PR
We just fixed the issue with using negative values
Christinadobrzyn commentedon Nov 4, 2025
I can reproduce this on iOS following the steps in the OP. Adding External.
[-]Deleted workspace still visible in recipient list when creating an expense via FAB[/-][+][$250] Deleted workspace still visible in recipient list when creating an expense via FAB[/+]melvin-bot commentedon Nov 4, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021985812442777928560
melvin-bot commentedon Nov 4, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)IjaazA commentedon Nov 5, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating an expense after deleting all workspaces, deleted workspaces still appear in the recipient list on web.
What is the root cause of that problem?
The isValidReport function in src/libs/OptionsListUtils/index.ts did not handle deleted policy expense chats.
There was no validation in addParticipant (in src/pages/iou/request/step/IOURequestStepParticipants.tsx) to prevent selecting deleted workspaces.
As a result, deleted workspaces were still being treated as valid options, leading to invalid navigation and expense creation.
What changes do you think we should make in order to solve the problem?
Filter deleted workspaces from the recipient list
Update isValidReport to exclude policy expense chats from deleted workspaces.
Use the isPendingDeletePolicy utility to check if the workspace is deleted.
Prevent such workspaces from being shown in the recipient list.
Add validation for deleted workspace selection
In addParticipant, add a check to determine if the selected workspace is deleted.
If it is, display an error message instead of navigating or creating an expense.
Maintain a state to track and display this error.
Add a translation key for the error message
Added workspace.common.deletedWorkspaceError in src/languages/en.ts:
"This workspace has been deleted and cannot be used for expenses."
What alternative solutions did you explore? (Optional)
brunovjk commentedon Nov 6, 2025
It's on my list. Reviewing ASAP.
Christinadobrzyn commentedon Nov 11, 2025
Hi @brunovjk just checking on this to see if you have any update!
melvin-bot commentedon Nov 11, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
brunovjk commentedon Nov 12, 2025
@Christinadobrzyn I can't reproduce it:
iOS: HybridApp - Latest main (12 Nov - v9.2.54-1 Develop)
Screen.Recording.2025-11-12.at.11.02.15.mov
MacOS: Chrome / Safari - Staging (v9.2.54-1)
Screen.Recording.2025-11-12.at.11.05.59.mov
Can you still? Apologies for the delay. Thank you.
Christinadobrzyn commentedon Nov 13, 2025
Asking QA to retest - https://expensify.slack.com/archives/C9YU7BX5M/p1762997535171509
m-natarajan commentedon Nov 13, 2025
Not repro, Windows 11 / Chrome v9.2.57-0
left.ws.mp4
Christinadobrzyn commentedon Nov 13, 2025
sounds like this is not reproducible. I think this can be closed? @brunovjk did you do any work here?
brunovjk commentedon Nov 13, 2025
Great! Nothing special, I'm just testing and trying to reproduce.
Christinadobrzyn commentedon Nov 13, 2025
Ok sounds good, I'm going to close. Thank you!