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
[Hold #83782] [$250] Expense-Self DM expense creates new report without workspace #82792
Version Number: V9.3.21-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:#80213 Email or phone of affected tester (no customers):dreamnitethedragon@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redminote 10S Android 13 App Component: Money Requests
Action Performed:
Launch app
Login with new account
Create 2 expenses in self dm
Go to reports
Select both expenses - move expense - create report
Note expenses are not shown in expense /expense reports section
Tap search - expense report chat
Tap from link
Note directed to self dm
Go to reports - chat
Tap in expense report link
Tap from link
Note user directed to self dm
Expected Result:
Account has no workspace so new report creation must not be possible.
Actual Result:
Account has no workspace but new report is created when moving self dm expense via create report.
Please re-state the problem that we are trying to solve in this issue.
A user with no workspace can create a new expense report by selecting self-DM expenses and using "Move expense" → "Create Report". The created report is orphaned — it has no policyID, no parentReportID, expenses don't appear in the expense reports section, and the "From" link redirects to the self-DM instead of the report.
What is the root cause of that problem?
There are three entry points to the "Move expense" → "Create Report" flow, and they handle workspace validation inconsistently:
IOURequestStepReport (single transaction move) — Correct. At line 291, it conditionally passes createReport as undefined when no workspace exists, hiding the button entirely:
IOURequestEditReport (bulk move from report view) — UI bug only. At line 160, it always passes createReport={createReport} (truthy), so the "Create Report" button is always visible. However, guards at lines 136 and 115 prevent actual report creation — the button is a silent no-op.
SearchTransactionsChangeReport (bulk move from search) — Critical bug. At line 200, it always passes createReport={createReport}, showing the button. The createReport function (lines 133-143) has no guard for missing policyForMovingExpensesID. When a user has no workspace, shouldSelectPolicy is false and policyForMovingExpensesID is undefined, so the function falls through to handleCreateReport(). Additionally, createReportForPolicy (lines 96-124) has no guard either (unlike IOURequestEditReport which checks !policyForMovingExpenses?.id), so it calls createNewReport with undefined policy, creating an orphaned report with no policyID.
The usePolicyForMovingExpenses hook (line 80) returns {policyForMovingExpensesID: undefined, shouldSelectPolicy: false} when a user has zero paid group policies, which is the trigger condition.
What changes do you think we should make in order to solve the problem?
Apply the same pattern used by IOURequestStepReport to the other two entry points:
SearchTransactionsChangeReport.tsx (line 200): Change createReport={createReport} to conditionally pass undefined when no workspace exists:
This hides the non-functional button instead of showing a no-op.
What alternative solutions did you explore? (Optional)
An alternative would be to add the guard only inside IOURequestEditReportCommon (the shared component that renders the "Create Report" button), checking if a valid policy exists before rendering the button. However, this would require threading the policyForMovingExpensesID prop down to that component. The proposed approach is simpler and consistent with the existing correct pattern in IOURequestStepReport.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Expense-Self DM expense creates new report without workspace[/-][+][$250] Expense-Self DM expense creates new report without workspace[/+]on Mar 3, 2026
changed the title [-][$250] Expense-Self DM expense creates new report without workspace[/-][+][Hold #83782] [$250] Expense-Self DM expense creates new report without workspace[/+]on Mar 30, 2026
Activity
melvin-bot commentedon Mar 3, 2026
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.MelvinBot commentedon Mar 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A user with no workspace can create a new expense report by selecting self-DM expenses and using "Move expense" → "Create Report". The created report is orphaned — it has no
policyID, noparentReportID, expenses don't appear in the expense reports section, and the "From" link redirects to the self-DM instead of the report.What is the root cause of that problem?
There are three entry points to the "Move expense" → "Create Report" flow, and they handle workspace validation inconsistently:
IOURequestStepReport(single transaction move) — Correct. At line 291, it conditionally passescreateReportasundefinedwhen no workspace exists, hiding the button entirely:IOURequestEditReport(bulk move from report view) — UI bug only. At line 160, it always passescreateReport={createReport}(truthy), so the "Create Report" button is always visible. However, guards at lines 136 and 115 prevent actual report creation — the button is a silent no-op.SearchTransactionsChangeReport(bulk move from search) — Critical bug. At line 200, it always passescreateReport={createReport}, showing the button. ThecreateReportfunction (lines 133-143) has no guard for missingpolicyForMovingExpensesID. When a user has no workspace,shouldSelectPolicyisfalseandpolicyForMovingExpensesIDisundefined, so the function falls through tohandleCreateReport(). Additionally,createReportForPolicy(lines 96-124) has no guard either (unlikeIOURequestEditReportwhich checks!policyForMovingExpenses?.id), so it callscreateNewReportwithundefinedpolicy, creating an orphaned report with nopolicyID.The
usePolicyForMovingExpenseshook (line 80) returns{policyForMovingExpensesID: undefined, shouldSelectPolicy: false}when a user has zero paid group policies, which is the trigger condition.What changes do you think we should make in order to solve the problem?
Apply the same pattern used by
IOURequestStepReportto the other two entry points:SearchTransactionsChangeReport.tsx(line 200): ChangecreateReport={createReport}to conditionally passundefinedwhen no workspace exists:Also add a defensive guard in
createReportForPolicy(line 96) to matchIOURequestEditReport's pattern: early-return if!policyForMovingExpenses?.id.IOURequestEditReport.tsx(line 160): ChangecreateReport={createReport}to conditionally passundefined:This hides the non-functional button instead of showing a no-op.
What alternative solutions did you explore? (Optional)
An alternative would be to add the guard only inside
IOURequestEditReportCommon(the shared component that renders the "Create Report" button), checking if a valid policy exists before rendering the button. However, this would require threading thepolicyForMovingExpensesIDprop down to that component. The proposed approach is simpler and consistent with the existing correct pattern inIOURequestStepReport.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Mar 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ChavdaSachin (
External)[-]Expense-Self DM expense creates new report without workspace[/-][+][$250] Expense-Self DM expense creates new report without workspace[/+]melvin-bot commentedon Mar 3, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022028952380107544651
melvin-bot commentedon Mar 9, 2026
@ChavdaSachin Eep! 4 days overdue now. Issues have feelings too...
16 remaining items
MelvinBot commentedon Mar 17, 2026
🤖 Draft PR created: #85569
Please mark it as "Ready for review" when it is ready for review.
aimane-chnaif commentedon Mar 17, 2026
We might need to hold this for #83782
melvin-bot commentedon Mar 18, 2026
@NicMendonca @ChavdaSachin this issue is now 4 weeks old, please consider:
Thanks!
ChavdaSachin commentedon Mar 18, 2026
Someone please put this on hold for #83782
melvin-bot commentedon Mar 24, 2026
@ChavdaSachin Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Mar 26, 2026
@ChavdaSachin Still overdue 6 days?! Let's take care of this!
[-][$250] Expense-Self DM expense creates new report without workspace[/-][+][Hold #83782] [$250] Expense-Self DM expense creates new report without workspace[/+]ChavdaSachin commentedon Apr 16, 2026
@NicMendonca, the issue has been resolved in pull request #83782.
We can proceed with closing this issue.