Skip to content

[Hold #83782] [$250] Expense-Self DM expense creates new report without workspace #82792

Closed

Description

@nlemma

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: 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:

  1. Launch app
  2. Login with new account
  3. Create 2 expenses in self dm
  4. Go to reports
  5. Select both expenses - move expense - create report
  6. Note expenses are not shown in expense /expense reports section
  7. Tap search - expense report chat
  8. Tap from link
  9. Note directed to self dm
  10. Go to reports - chat
  11. Tap in expense report link
  12. Tap from link
  13. 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.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7081314_1771417405383.Screenrecorder-2026-02-18-17-44-08-522.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ChavdaSachin
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022028952380107544651
  • Upwork Job ID: 2028952380107544651
  • Last Price Increase: 2026-03-17

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 3, 2026
  2. melvin-bot commented on Mar 3, 2026

    @melvin-bot

    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.

  3. MelvinBot commented on Mar 3, 2026

    @MelvinBot
    Contributor

    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, 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:

    1. IOURequestStepReport (single transaction move) — Correct. At line 291, it conditionally passes createReport as undefined when no workspace exists, hiding the button entirely:

      createReport={policyForMovingExpensesID || shouldSelectPolicy || isPerDiemTransaction ? createReport : undefined}
      
    2. 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.

    3. 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:

    1. SearchTransactionsChangeReport.tsx (line 200): Change createReport={createReport} to conditionally pass undefined when no workspace exists:

      createReport={policyForMovingExpensesID || shouldSelectPolicy ? createReport : undefined}
      

      Also add a defensive guard in createReportForPolicy (line 96) to match IOURequestEditReport's pattern: early-return if !policyForMovingExpenses?.id.

    2. IOURequestEditReport.tsx (line 160): Change createReport={createReport} to conditionally pass undefined:

      createReport={policyForMovingExpensesID || shouldSelectPolicy || hasPerDiemTransactions ? createReport : undefined}
      

      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.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 3, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 3, 2026
  6. melvin-bot commented on Mar 3, 2026

    @melvin-bot

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

  7. 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
  8. melvin-bot commented on Mar 3, 2026

    @melvin-bot
  9. melvin-bot commented on Mar 9, 2026

    @melvin-bot

    @ChavdaSachin Eep! 4 days overdue now. Issues have feelings too...

  10. 16 remaining items

  11. MelvinBot commented on Mar 17, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #85569
    Please mark it as "Ready for review" when it is ready for review.

  12. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 17, 2026
  13. aimane-chnaif commented on Mar 17, 2026

    @aimane-chnaif
    Contributor

    We might need to hold this for #83782

  14. melvin-bot commented on Mar 18, 2026

    @melvin-bot

    @NicMendonca @ChavdaSachin this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  15. ChavdaSachin commented on Mar 18, 2026

    @ChavdaSachin
    Contributor

    Someone please put this on hold for #83782

  16. melvin-bot commented on Mar 24, 2026

    @melvin-bot

    @ChavdaSachin Huh... This is 4 days overdue. Who can take care of this?

  17. melvin-bot commented on Mar 26, 2026

    @melvin-bot

    @ChavdaSachin Still overdue 6 days?! Let's take care of this!

  18. 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
  19. ChavdaSachin commented on Apr 16, 2026

    @ChavdaSachin
    Contributor

    @NicMendonca, the issue has been resolved in pull request #83782.
    We can proceed with closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions