Skip to content

[Due for payment 2026-04-14] Expense - Undeleted expense does not load when undeleted and opened offline #86793

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.3.51-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #85818
Email or phone of affected tester (no customers): soidnjsojdiosjiosdjo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Delete the expense.
  5. Go to Reports > Expenses.
  6. Click Status, select Deleted and click Apply.
  7. Go offline.
  8. Select the expense via checkbox.
  9. Click dropdown button > Undelete.
  10. Go to Inbox and open self DM.
  11. Open the undeleted expense.

Expected Result:

The undeleted expense will load.

Actual Result:

The undeleted expense does not load. It opens "Say hello!" page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7118355_1774987419998.3.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @jnowakow

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Mar 31, 2026
  2. melvin-bot commented on Mar 31, 2026

    @melvin-bot

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

  3. melvin-bot commented on Mar 31, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 31, 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.
  5. OSBotify commented on Mar 31, 2026

    @OSBotify
    Contributor

    Classification: Frontend bug | Causing PR: #85818 - "[Payment due @rojiphil] Deleted transactions on search" by @jnowakow (High confidence) | Recommendation: REVERT | This PR introduces a complex flow for undeleting transactions that fails when performed offline. The transaction thread creation logic does not properly handle the offline scenario, resulting in navigation failures. | Labels: Both DeployBlockerCash and DeployBlocker should remain in place as this is reproducible on staging and affects the App (frontend).

  6. OSBotify commented on Mar 31, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #85818 - "[Payment due @rojiphil] Deleted transactions on search" by @jnowakow (High confidence)
    Related Issues: None

    Recommendation: REVERT

    This PR introduces a complex flow for undeleting transactions that fails when performed offline. The transaction thread creation logic does not properly handle the offline scenario, resulting in navigation failures.

    Labels: Both DeployBlockerCash and DeployBlocker should remain in place as this is reproducible on staging and affects the App (frontend).

    📋 Detailed Analysis

    Evidence

    • Issue was caught during regression testing of PR [Payment due @rojiphil] Deleted transactions on search #85818
    • Reproducible on staging (version 9.3.51-0), not applicable in production (new feature)
    • The bug occurs specifically when:
      1. User undeletes a transaction while offline
      2. Navigates to self DM
      3. Attempts to open the undeleted expense
      4. Instead of loading the expense, it shows "Say hello!" page

    Verification

    The PR modifies multiple files related to transaction deletion/undeletion:

    • `src/libs/actions/Transaction.ts` - Core `changeTransactionsReport` function (41 additions, 31 deletions)
    • `src/hooks/useUndeleteTransactions.ts` - New hook for undeleting transactions
    • `src/components/Search/SearchList/ListItem/TransactionListItem.tsx` - Disables clicking on deleted transactions
    • `src/libs/TransactionUtils/index.ts` - Adds `isDeletedTransaction` helper
    • Multiple files for UI changes to support deleted transaction status

    The PR correctly identifies deleted transactions by checking if `transaction.reportID === CONST.REPORT.TRASH_REPORT_ID` ("-1").

    Root Cause

    When a transaction is undeleted via `changeTransactionsReport()`:

    1. Deleted transactions have no old IOU action: Line 1023 in `src/libs/actions/Transaction.ts`:
      ```typescript
      const oldIOUAction = isDeletedExpense ? undefined : getIOUActionForReportID(...)
      ```
      The comment explains: "Skip lookup for deleted transactions: the old IOU action is already cleaned up during deletion and its transaction thread is deleted, so reusing it is harmful."

    2. A new transaction thread must be created: When `oldIOUAction` is undefined, the code creates a completely new transaction thread (lines 1335-1393). This includes:

      • Creating an optimistic transaction thread report
      • Creating a new IOU action
      • Linking the thread to the parent report
    3. Offline navigation failure: When the undelete happens while offline:

      • The optimistic data creates the new transaction thread
      • The transaction's `reportID` is changed from "-1" to the selfDM report ID
      • However, when the user tries to navigate to this expense, the transaction thread report is not properly accessible or the navigation fails to resolve the correct route
      • This causes the app to fall back to showing the "Say hello!" page instead of the expense details

    The issue is that the offline transaction thread creation and navigation logic does not properly handle the case where a deleted transaction is being restored without a previous IOU action to reference.

  7. removed
    DeployBlocker
    on Mar 31, 2026
  8. 7 remaining items

  9. removed
    DeployBlockerCash
    on Apr 1, 2026
  10. added
    Weekly
    Awaiting Payment
    and removed
    Hourly
    on Apr 7, 2026
  11. changed the title [-]Expense - Undeleted expense does not load when undeleted and opened offline[/-] [+][Due for payment 2026-04-14] Expense - Undeleted expense does not load when undeleted and opened offline[/+] on Apr 7, 2026
  12. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. removed
    Reviewing
    on Apr 7, 2026
  14. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.52-9 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 2026-04-14. 🎊

    For reference, here are some details about the assignees on this issue:

    • @jnowakow does not require payment (Contractor)
  15. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    @luacmartins @jnowakow 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]

  16. melvin-bot commented on Apr 7, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  17. added
    Reviewing
    Weekly
    and removed
    Weekly
    on Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugEngineeringReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions