Skip to content

Reports - Expense is submitted to Self DM instead of WS chat if submissions are disabled #76680

Closed

Description

@vincdargento

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.71-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: undefined
Email or phone of affected tester (no customers): ibellicotest+2154@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 / Android 12 / Chrome ( mWeb / Hybrid app) - Windows 11 / Chrome
App Component: Search

Action Performed:

Prerequisite: Account has a workspace with submission frequency disabled and approvals enabled.
Prerequisite 2: Account has Self DM.

  1. Open the Expensify app.
  2. Navigate to "Reports" > "Reports"
  3. Create a manual expense and submit it to a workspace.
  4. Note that the just created expense is not displayed on "Reports"
  5. Navigate to workspace chat.
  6. Note that expense is not displayed.
  7. Navigate to Self DM.
  8. Note that expense was submitted to Self DM instead of workspace chat.

Expected Result:

Expense submitted to workspace while on "Reports", should correctly appear on chat.

Actual Result:

Expense submitted to workspace chat while on "Reports" section, is submitted to Self DM instead of workspace chat when submission frequency is disabled.
This issue is not reproducible if expense is created while on chat. It only happens when expense is created on "Reports"

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

bug.mp4

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 4, 2025
  2. melvin-bot commented on Dec 4, 2025

    @melvin-bot

    Triggered auto assignment to @twisterdotcom (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. nyomanjyotisa commented on Dec 4, 2025

    @nyomanjyotisa
    Member

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Reports - Expense is submitted to Self DM instead of WS chat if submissions are disabled

    What is the root cause of that problem?

    When submission frequency is disabled (autoReporting is false), the transaction's reportID is set to CONST.REPORT.UNREPORTED_REPORT_ID, which makes isUnreported true

    const isUnreported = transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;

    In the confirmation flow, when isUnreported is true, the expense is routed to trackExpense instead of requestMoney

    if (iouType === CONST.IOU.TYPE.TRACK || isCategorizingTrackExpense || isSharingTrackExpense || isUnreported) {

    The trackExpense function calls getTrackExpenseInformation, which defaults to Self DM when no chat report is passed

    App/src/libs/actions/IOU.ts

    Lines 4094 to 4096 in e8bcafa

    // If no chat report is passed, defaults to the self-DM report
    if (!chatReport) {
    chatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${findSelfDMReportID()}`] ?? null;

    This causes expenses created from the Reports section to go to Self DM instead of the workspace chat

    What changes do you think we should make in order to solve the problem?

    We should only route to trackExpense when isUnreported is true and the participant is not a policy expense chat

                if (iouType === CONST.IOU.TYPE.TRACK || isCategorizingTrackExpense || isSharingTrackExpense || (isUnreported && !isPolicyExpenseChat)) {

    if (iouType === CONST.IOU.TYPE.TRACK || isCategorizingTrackExpense || isSharingTrackExpense || isUnreported) {

    What alternative solutions did you explore? (Optional)

    None

  4. Nodebrute commented on Dec 4, 2025

    @Nodebrute
    Contributor

    It’s expected behavior, based on the implementation in this PR

  5. twisterdotcom commented on Dec 4, 2025

    @twisterdotcom
    Contributor

    Yeah agree, expenses are unreported if reporting frequency is disabled.

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions