Skip to content

[Due for Payment 2026-04-09][$75] Expense - Report turns to skeleton loader after merging expenses offline #72076

Closed

Description

@jponikarchuk

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.27-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: #71747
Email or phone of affected tester (no customers): jsdoijnsojsonidjsij@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense in workspace chat.
  4. Create a second report via + > Create report.
  5. On the second report, click Add expense > Create expense.
  6. Create an expense on the second report.
  7. Open the second report.
  8. Go offline.
  9. Click More > Merge.
  10. Select the first expense from Step 3 > Continue.
  11. Select all the second options for each section.
  12. Click Continue > Merge expenses.

Expected Result:

The report will show the merged expense.

Actual Result:

The report turns to skeleton loader.

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

11.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021976820760776060646
  • Upwork Job ID: 1976820760776060646
  • Last Price Increase: 2026-04-17
Issue OwnerCurrent Issue Owner: @parasharrajat
Issue OwnerCurrent Issue Owner: @neil-marcellini

Activity

  1. added
    Daily
    Bug
    on Oct 8, 2025
  2. melvin-bot commented on Oct 8, 2025

    @melvin-bot

    Triggered auto assignment to @brianlee-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. paulnjs commented on Oct 8, 2025

    @paulnjs
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-10-15 14:17:44 UTC.

    Proposal

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

    The report turns to skeleton loader.

    What is the root cause of that problem?

    We have two transactions called A and B.

    When starting the merge flow with transaction B and select transaction A, the transaction A is sourceTransaction and the transaction B is targetTransaction. But if we select the report of transaction A, we still clear the transaction A's expense report here

    const optimisticSourceReportData: OnyxUpdate[] =
    transactionsOfSourceReport.length === 1
    ? [
    {
    onyxMethod: Onyx.METHOD.SET,
    key: `${ONYXKEYS.COLLECTION.REPORT}${sourceTransaction.reportID}`,
    value: null,
    },
    ]
    : [];

    Which causes the skeleton appears in offline because the report data is cleared

    const handleMergeExpenses = useCallback(() => {
    if (!targetTransaction || !mergeTransaction || !sourceTransaction) {
    return;
    }
    const reportID = mergeTransaction.reportID;
    setIsMergingExpenses(true);
    mergeTransactionRequest(transactionID, mergeTransaction, targetTransaction, sourceTransaction);

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

    With the flow in the RCA, if we select the report of transaction A, the targetTransaction now is transaction A and transaction B is sourceTransaction and we should clear the transaction B's expense report instead if this report only has one transaction

    We should swap the source and target transaction if the selected report is the source transaction report

    const currentSourceTransaction = reportID === targetTransaction.reportID ? sourceTransaction : targetTransaction;
    const currentTargetTransaction = reportID === targetTransaction.reportID ? targetTransaction : sourceTransaction;
    
    mergeTransactionRequest(transactionID, mergeTransaction, currentTargetTransaction, currentSourceTransaction);
    

    const handleMergeExpenses = useCallback(() => {
    if (!targetTransaction || !mergeTransaction || !sourceTransaction) {
    return;
    }
    const reportID = mergeTransaction.reportID;
    setIsMergingExpenses(true);
    mergeTransactionRequest(transactionID, mergeTransaction, targetTransaction, sourceTransaction);

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

    If we go with alternative solution, we can update mergeTransactionRequest test and assert the selected report is not cleared.

    What alternative solutions did you explore? (Optional)

    We can do the swap logic inside this function. By calculating transactionsOfSourceReport, iouActionOfSourceTransaction based on mergeTransaction.reportID. We can rename this to reportTransactionToDelete, iouActionToDelete to avoid the confusion. And then we need to update the correct the onyx data of the report which must be deleted

    const reportIDOfTransactionToDelete = mergeTransaction.reportID === targetTransaction.reportID ? sourceTransaction.reportID : targetTransaction.reportID;
    const transactionIDOfReportToDelete = mergeTransaction.reportID === targetTransaction.reportID ? sourceTransaction.transactionID : targetTransaction.transactionID;
    
    const transactionsOfSourceReport = getReportTransactions(reportIDOfTransactionToDelete);
    const iouActionOfSourceTransaction = getIOUActionForReportID(reportIDOfTransactionToDelete, transactionIDOfReportToDelete);
    

    const optimisticSourceReportData: OnyxUpdate[] =
    transactionsOfSourceReport.length === 1
    ? [
    {
    onyxMethod: Onyx.METHOD.SET,
    key: `${ONYXKEYS.COLLECTION.REPORT}${sourceTransaction.reportID}`,
    value: null,
    },
    ]
    : [];

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. added
    External
    on Oct 11, 2025
  5. changed the title [-]Expense - Report turns to skeleton loader after merging expenses offline[/-] [+][$250] Expense - Report turns to skeleton loader after merging expenses offline[/+] on Oct 11, 2025
  6. melvin-bot commented on Oct 11, 2025

    @melvin-bot
  7. added
    Help Wanted
    on Oct 11, 2025
  8. melvin-bot commented on Oct 11, 2025

    @melvin-bot

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

  9. brianlee-expensify commented on Oct 11, 2025

    @brianlee-expensify
    Contributor

    reproduced on staging.new.expensify.com

    2025-10-10_18-28-00.mp4
  10. 94 remaining items

  11. melvin-bot commented on Apr 17, 2026

    @melvin-bot

    Upwork job price has been updated to $75

  12. mallenexpensify commented on Apr 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @paulnjs paid $125 via Upwork
    Contributor+: @parasharrajat due $125 via NewDot

    There were two regressions, I just assigned you to both @parasharrajat
    #86817
    #86809

    @paulnjs can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022045195196152526825

    @parasharrajat plz complete the BZ checklist and tag me in a post once you have. Thx

  13. paulnjs commented on Apr 18, 2026

    @paulnjs
    Contributor

    @mallenexpensify I think there is only one regression here. #86817 is not because it can reproduce in production as I mentioned here. Could you please help to re-check and consider update the payment?

  14. parasharrajat commented on Apr 19, 2026

    @parasharrajat
    Member

    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: Merge expenses phase 1 #65596 (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: Not needed

    • [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: https://github.com/Expensify/Expensify/issues/625790

    Regression Test Proposal

    Test:

    1. Create an expense in workspace chat.
    2. Create a second report via + > Create report.
    3. On the second report, click Add expense > Create expense.
    4. Create an expense on the second report.
    5. Open the second report.
    6. Go offline.
    7. Click More > Merge.
    8. Select the first expense from Step 3 > Continue.
    9. Select all the second options for each section.
    10. Click Continue > Merge expenses.
    11. Verify that the app back to main chat

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-1fae-afbb-fd13-bef9e7d6e7f4
  15. parasharrajat commented on Apr 19, 2026

    @parasharrajat
    Member

    Done @mallenexpensify. Can you fix the summary?

  16. mallenexpensify commented on Apr 20, 2026

    @mallenexpensify
    Contributor

    summary updated. @paulnjs can you please accept the job below? Please reply here and tag me once you have.

    ^ Test case created

  17. paulnjs commented on Apr 20, 2026

    @paulnjs
    Contributor

    @mallenexpensify I accepted. Thanks!

  18. mallenexpensify commented on Apr 21, 2026

    @mallenexpensify
    Contributor

    @paulnjs paid, summary updated above. Thx. It's for $75 with $50 bonus

  19. parasharrajat commented on May 20, 2026

    @parasharrajat
    Member

    Payment requested as per #72076 (comment)

  20. garrettmknight commented on May 21, 2026

    @garrettmknight
    Contributor

    $125 approved for @parasharrajat

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions