Skip to content

[Due for payment 2025-06-05] [Due for payment 2025-06-04] IOU - Unending spinner when submitting an expense to a user #62695

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: v9.1.51-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught during regression testing, add the test name, ID and link from TestRail: #58020
Email or phone of affected tester (no customers): applausetester+mentiont1@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: MacOS Chrome, Desktop
App Component: Money Requests

Action Performed:

  1. Start a chat with a new user
  2. Submit two manual expenses
  3. Open the combined expense report
  4. Click on More button > Click on Delete > Click on Delete on confirmation modal
  5. Open one of the expenses that were deleted on step 4 and is moved to personal expenses
  6. Open the expense detail > click on the report header > submit it to someone
  7. Select the same user you have started chat with on step 1
  8. Click Create expense

Expected Result:

Expense should be submitted to the user

Actual Result:

Unending spinner is displayed on submit button

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

Bug6840601_1748031983677.Screen_Recording_2025-05-23_at_11.09.11_at_night.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on May 23, 2025
  2. melvin-bot commented on May 23, 2025

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (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. melvin-bot commented on May 23, 2025

    @melvin-bot

    Triggered auto assignment to @chiragsalian (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on May 23, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on May 23, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. twilight2294 commented on May 24, 2025

    @twilight2294
    Contributor

    Proposal

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

    Unending spinner when submitting an expense to a user.

    What is the root cause of that problem?

    There is an endless spinner because when we request money we need linkedTrackedExpenseReportAction:

    App/src/libs/actions/IOU.ts

    Lines 5195 to 5200 in 526a0e4

    switch (action) {
    case CONST.IOU.ACTION.SUBMIT: {
    if (!linkedTrackedExpenseReportAction || !linkedTrackedExpenseReportID) {
    return;
    }
    const workspaceParams =

    which is missing when expenses deleted from a report are transferred in selfDM, this causes us to return early and the endless spinner is present because when we get linkedTrackedExpenseReportAction in createDraftTransactionAndNavigateToParticipantSelector while submitting an expense:

    App/src/libs/ReportUtils.ts

    Lines 9592 to 9594 in 526a0e4

    const linkedTrackedExpenseReportAction = Object.values(reportActions)
    .filter(Boolean)
    .find((action) => isMoneyRequestAction(action) && getOriginalMessage(action)?.IOUTransactionID === transactionID);

    This will return none as there is no IOU report action for that report created and also we don't have it's IOUTransactionID.
    This is the RCA.

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

    When deleting the report, we should optimistically add the actionName and IOUTransactionID here:

    App/src/libs/actions/Report.ts

    Lines 4772 to 4781 in 526a0e4

    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${childReportID}`,
    value: {
    [newReportActionID]: {
    originalMessage: {
    movedToReportID: selfDMReportID,
    },
    },
    },
    },

    optimisticData.push(
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.REPORT}${childReportID}`,
                    value: {
                        parentReportActionID: newReportActionID,
                        parentReportID: selfDMReportID,
                        chatReportID: selfDMReportID,
                        policyID: CONST.POLICY.ID_FAKE,
                    },
                },
                {
                    onyxMethod: Onyx.METHOD.MERGE,
                    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${childReportID}`,
                    value: {
                        [newReportActionID]: {
                            actionName: CONST.REPORT.ACTIONS.TYPE.IOU,
                            originalMessage: {
                                IOUTransactionID: transactionID,
                                movedToReportID: selfDMReportID,
                            },
                        },
                    },
                },
            );

    Result video:

    Screen.Recording.2025-05-25.at.3.25.51.AM.mov

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

    N/A

    What alternative solutions did you explore? (Optional)

    N/A

  7. twilight2294 commented on May 24, 2025

    @twilight2294
    Contributor

    I can raise a quick PR @chiragsalian @mallenexpensify

  8. 33 remaining items

  9. changed the title [-][Due for payment 2025-06-04] IOU - Unending spinner when submitting an expense to a user[/-] [+][Due for payment 2025-06-05] [Due for payment 2025-06-04] IOU - Unending spinner when submitting an expense to a user[/+] on May 29, 2025
  10. melvin-bot commented on May 29, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.53-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-06-05. 🎊

  11. melvin-bot commented on May 29, 2025

    @melvin-bot

    @chiragsalian @mallenexpensify @chiragsalian The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  12. melvin-bot commented on Jun 5, 2025

    @melvin-bot

    Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

  13. melvin-bot commented on Jun 6, 2025

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  14. mallenexpensify commented on Jun 6, 2025

    @mallenexpensify
    Contributor
  15. allgandalf commented on Jun 9, 2025

    @allgandalf
    Contributor

    Hi @mallenexpensify, This issue and the issue you pointed above were regressions from my PR:

    So as the author, I fixed the issues, so no payments due here

  16. melvin-bot commented on Jun 10, 2025

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

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.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions