Skip to content

[Due for payment 2025-07-04] [$250] Expense - Extra expense with infinite loading appears in Self DM after deleting report in WS #64027

Closed

Description

@mitarachim

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.1.65-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): ibellicotest+1029@gmail.com
Issue reported by: Applause Internal Team
Device used: Motorola MotoG60 - Android 12 - Chrome (mWeb - Hybrid App) / Windows 10 - Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least one workspace created and Self DM.
Prerequisite: Delayed submissions and approvals enabled.

  1. Open the staging.new.expensify.com website.
  2. Open any workspace chat.
  3. Submit a manual expense to it.
  4. Navigate to Self DM.
  5. Submit another manual expense to it so that now you have 2 expenses on one report.
  6. Open the expense created in Self DM.
  7. Tap on the report field and select the report of the expense created in workspace chat.
  8. Navigate to workspace chat.
  9. Submit, approve and pay the expenses on the report.
  10. Open the report and tap on "More"
  11. Tap on "Cancel Payment"
  12. Unapprove the expense.
  13. Delete the report.
  14. Navigate to Self DM again.
  15. Note that both expenses are displayed as unreported on Self DM, and that a third preview, that can´t be opened, is also displayed, showing infinite loading.

Expected Result:

After cancelling payment, unapproving and deleting a report on a workspace chat, expenses on it should be moved to Self DM and no extra expense should be displayed with them.

Actual Result:

When the user cancels a payment, unapprove and deletes a report on a workspace chat, that contains an expense that was moved from Self DM, the expenses on the report, are moved to Self DM again, but now, an extra expense preview, that can´t be opened, appears showing infinite loading.

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

Bug6857548_1749684457124.Third.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021933269725743755856
  • Upwork Job ID: 1933269725743755856
  • Last Price Increase: 2025-06-12
Issue OwnerCurrent Issue Owner: @clarajones-expensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @clarajones-expensify (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. bernhardoj commented on Jun 12, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Extra expenses with infinite loading in self DM after deleting report where the report is previously paid.

    What is the root cause of that problem?

    When we delete a report, we optimistically move all money request action to self DM. However, money request action also includes pay action.

    App/src/libs/actions/Report.ts

    Lines 4748 to 4751 in 04a715b

    Object.values(reportActionsForReport ?? {}).forEach((reportAction) => {
    if (!ReportActionsUtils.isMoneyRequestAction(reportAction)) {
    return;
    }

    This causes the extra expense.

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

    We can return early too if the action is a pay action.

    if (!ReportActionsUtils.isMoneyRequestAction(reportAction) || ReportActionsUtils.isPayAction(reportAction)) {
        return;
    }

    OR

    We can return early if the originalMessage.type is not track or create.

    const originalMessage = ReportActionsUtils.getOriginalMessage(reportAction);
    if (originalMessage?.type !== CONST.IOU.REPORT_ACTION_TYPE.CREATE && originalMessage?.type !== CONST.IOU.REPORT_ACTION_TYPE.TRACK) {
        return;
    }

    (there is another issue I noticed where the LHN item of the expense thread shows Hidden)

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    We can test deleteAppReport where the report has a pay action and assert that there is no extra expenses.

  4. clarajones-expensify commented on Jun 12, 2025

    @clarajones-expensify
    Contributor

    Notes: I was able to reproduce

  5. changed the title [-]Expense - Extra expense with infinite loading appears in Self DM after deleting report in WS[/-] [+][$250] Expense - Extra expense with infinite loading appears in Self DM after deleting report in WS[/+] on Jun 12, 2025
  6. melvin-bot commented on Jun 12, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 12, 2025
  8. melvin-bot commented on Jun 12, 2025

    @melvin-bot

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

  9. clarajones-expensify commented on Jun 12, 2025

    @clarajones-expensify
    Contributor

    Hi @DylanDylann - would you review the above proposal? Thank you!

  10. DylanDylann commented on Jun 13, 2025

    @DylanDylann
    Contributor

    @bernhardoj's proposal looks fine to me. Besides checking actionName we also need to verify the originalMessage.type

    🎀👀🎀 C+ reviewed

  11. 24 remaining items

  12. melvin-bot commented on Jul 4, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@clarajones-expensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1933269725743755856/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  13. clarajones-expensify commented on Jul 7, 2025

    @clarajones-expensify
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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:

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

    • [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.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    Do we agree 👍 or 👎

  14. clarajones-expensify commented on Jul 7, 2025

    @clarajones-expensify
    Contributor

    @DylanDylann would you fill out the above checklist? thanks!

  15. DylanDylann commented on Jul 7, 2025

    @DylanDylann
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: [Simplified Actions] Implement DeleteAppReport  #58020 (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:

    • [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.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    1. Create 2 money requests in expense chat
    2. Submit, approve, pay the report
    3. Cancel payment, unapproved, undo close/submit the report
    4. Delete the report
    5. Open the self DM
    6. Verify there is no extra expense with infinite skeleton loader

    Do we agree 👍 or 👎

  16. clarajones-expensify commented on Jul 7, 2025

    @clarajones-expensify
    Contributor

    Payment Summary

    C: @bernhardoj owed $250 via NewDot manual payment
    C+: @DylanDylann owed $250 via NewDot manual payment

  17. bernhardoj commented on Jul 7, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  18. clarajones-expensify commented on Jul 7, 2025

    @clarajones-expensify
    Contributor
  19. clarajones-expensify commented on Jul 7, 2025

    @clarajones-expensify
    Contributor

    Closed job in Upwork

  20. JmillsExpensify commented on Jul 9, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  21. trjExpensify commented on Oct 3, 2025

    @trjExpensify
    Contributor

    approved $250 for @DylanDylann.

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

Metadata

Metadata

Labels

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions