Skip to content

[No Payment] Expense - In expensifail account, opening report deleted in offline is loading infinitely #82622

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: V9.3.20-2
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #79761
https://test-management.browserstack.com/projects/2219752/folder/13176670/test-cases/41237106?q=Deleted
Email or phone of affected tester (no customers): Applausetester+soao@applause.expensifail.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 with expensifail account
  2. Open workspace chat
  3. Create a distance map expense
  4. Go to reports - reports
  5. Go offline and delete the report
  6. Note report is striked through
  7. Open the report
  8. Note report deleted in offline is loading infinitely

Expected Result:

In expensifail account, opening report deleted in offline must not load infinitely.

Actual Result:

In expensifail account, opening report deleted in offline is loading infinitely.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @brianlee-expensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 17, 2026
  2. melvin-bot commented on Feb 17, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #79761

  3. melvin-bot commented on Feb 17, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 17, 2026

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

  5. github-actions commented on Feb 17, 2026

    @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. OSBotify commented on Feb 17, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #79761 - "fix: Deleting a draft report from search deletes the expenses as well." by @daledah (High confidence)
    Related Issues: #79756

    Recommendation: REVERT

    The causing PR should be reverted. PR #79761 introduced a critical bug in the offline deletion flow by not passing the hash parameter to deleteAppReport, which prevents the search snapshot from being updated with the pending delete action. This causes reports deleted while offline to load infinitely when opened.

    Labels: No label changes made. This is a frontend bug that requires an App PR fix/revert, so DeployBlockerCash correctly remains on this issue.

    📋 Detailed Analysis

    Evidence

    PR #79761 changed the deletion logic for expense reports in the search results page. When deleting expense reports from search results, it now calls deleteAppReport in a loop instead of using bulkDeleteReports.

    The Problem: Line 504-512 in src/pages/Search/SearchPage.tsx calls deleteAppReport without passing the hash parameter:

    deleteAppReport(
        report,
        selfDMReport,
        currentUserPersonalDetails?.email ?? ,
        currentUserPersonalDetails?.accountID,
        validTransactions,
        allTransactionViolations,
        bankAccountList,
        // Missing: hash parameter should be passed here
    );

    In contrast, the else branch (line 518-529) correctly passes hash to bulkDeleteReports.

    Verification

    The deleteAppReport function in src/libs/actions/Report/index.ts (line 5053-5077) has this critical code:

    function deleteAppReport(
        report: OnyxEntry<Report>,
        selfDMReport: OnyxEntry<Report>,
        currentUserEmailParam: string,
        currentUserAccountIDParam: number,
        reportTransactions: Record<string, Transaction>,
        allTransactionViolations: OnyxCollection<TransactionViolations>,
        bankAccountList: OnyxEntry<BankAccountList>,
        hash?: number,  // This parameter is optional but critical for search
    ) {
        // ...
        // Update search results to mark report as deleted when called from search
        if (hash) {
            Onyx.merge(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`, {
                data: {
                    [`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]: {pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE},
                },
            });
        }
        // ...
    }

    Without the hash parameter, the search snapshot is never updated to show the report has a pending delete action.

    Root Cause

    When a user deletes a report while offline:

    1. The report is optimistically marked for deletion in local state
    2. BUT the search snapshot (SNAPSHOT collection in Onyx) is NOT updated because hash was not passed
    3. When the user opens the deleted report, the app tries to load it
    4. The report is in an inconsistent state (marked for deletion locally but not in the search snapshot)
    5. This causes infinite loading because the app cannot reconcile the conflicting states

    Impact

  7. 13 remaining items

  8. daledah commented on Feb 18, 2026

    @daledah
    Contributor

    @mountiny @ShridharGoel we have the follow up PR here

  9. melvin-bot commented on Mar 13, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @chuckdries, @ShridharGoel, @brianlee-expensify eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  10. chuckdries commented on Mar 16, 2026

    @chuckdries
    Contributor

    This should be due for payment

  11. brianlee-expensify commented on Mar 16, 2026

    @brianlee-expensify
    Contributor

    @mountiny based on your previous comment, is this considered a regression?

    @ShridharGoel can you fill out the bugzero checklist and confirm whether a regression test is needed for this one?

  12. brianlee-expensify commented on Mar 16, 2026

    @brianlee-expensify
    Contributor

    deployed to prod on March 2, 2026 (see here) - updating title for payment date of March 9, 2026

  13. changed the title [-]Expense - In expensifail account, opening report deleted in offline is loading infinitely[/-] [+][Due for payment 2026-03-09] Expense - In expensifail account, opening report deleted in offline is loading infinitely[/+] on Mar 16, 2026
  14. mountiny commented on Mar 16, 2026

    @mountiny
    Contributor

    Yeah seems like it was a follow up to #79761 so no payment?

  15. changed the title [-][Due for payment 2026-03-09] Expense - In expensifail account, opening report deleted in offline is loading infinitely[/-] [+][No Payment] Expense - In expensifail account, opening report deleted in offline is loading infinitely[/+] on Mar 17, 2026
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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions