Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.4.48-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/67224479/folder/52649115/104398848/1622118101?q=Undelete&issue_type=jira
Email or phone of affected tester (no customers): ibellicotest+2766@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests
Action Performed:
Prerequisite: Account has Self DM.
Prerequisite 2: Account has a workspace.
- Open the staging.new.expensify.com website.
- Create a manual expense and submit it to Self DM.
- Navigate to "Spend" > "Expenses"
- Select and delete the just created expense.
- Click on "FIlters" > "Status" > "Deleted"
- Select the just deleted expense.
- Click on dropdown menu > "Undelete"
- Return to Self DM.
- Open the expense.
- Click on report field > "Create Report"
- Note that a "It´s not here" message appears on RHP after expense is moved.
- Navigate to workspace chat and reopen expense.
- Note that infinite loading is displayed.
- Right click on expense preview and delete it.
- Note that expense returns to Self DM.
Expected Result:
User should be able to move and undeleted expense to a new report in workspace chat.
Actual Result:
User is unable to move an undeleted expense to a new report in workspace chat. "It´s not here" is displayed on RHP after expense is moved and infinite loading experienced when reopening expense in workspace chat.
After deleting expense from workspace chat, it returns to Self DM.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7224028_1785686196854.Move_Undelete.mp4
Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7224028
Issue Owner
Current Issue Owner: @mallenexpensifyMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Aug 3, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/73106e210225f85f71fffb6f7f72151769ac1941f16fa042ce0e7746a9f90a66
MelvinBot commentedon Sep 5, 2026
Proposal
What is the root cause of that problem?
Deleting a Self DM expense leaves a stale IOU report action in the Self DM that still points at the transaction. After Undelete, the Self DM contains two actions for the same
transactionID, and "Create Report" picks the stale (deleted) one — which carries achildReportIDfor a transaction thread that no longer exists.The chain:
getDeleteTrackExpenseInformationwithshouldRemoveIOUTransaction: false(src/libs/actions/IOU/TrackExpense.ts:3057). The original IOU action is blanked (html: '',pendingAction: DELETE) but keepsoriginalMessage.IOUTransactionID(TrackExpense.ts:697-716). Its transaction thread is removed.changeTransactionsReportwith no destination, i.e. "move to Unreported" (src/hooks/useUndeleteTransactions.ts:31-51). Because the transaction is still in Trash, the old-action lookup is deliberately skipped (src/libs/actions/Transaction.ts:1098-1104), so a brand new IOU action and thread are created — leaving the blanked one in place. The Self DM now has two actions matching thistransactionID.changeTransactionsReportagain. The transaction is no longer in Trash, so the lookup runs — andgetIOUActionForTransactionIDis an unfiltered.find()with no deleted/pending check, so it can return the stale action (src/libs/ReportActionsUtils.ts:2689-2706).newIOUActionis built as{...oldIOUAction}(Transaction.ts:1123-1138), inheriting the danglingchildReportIDand the blanked message. BecausechildReportIDis truthy, the "create the thread if missing" branch is skipped (Transaction.ts:1594-1600), and the thread merge is also skipped because that report isn't in Onyx (Transaction.ts:1565-1580).So the moved expense points at a transaction thread that exists nowhere: the RHP resolves no report and renders the not-found page (
src/pages/inbox/ReportNotFoundGuard.tsx:56-73), and the workspace-chat preview never gets data to render. The expense reappearing in the Self DM after deletion is the backend state showing through once the optimistic overlay is gone — the move was never committed with a valid thread.What changes do you think we should make in order to solve the problem?
Transaction.ts:1104, skip actions that are deleted (isDeletedAction) or havependingAction === DELETE, and prefer the most recently created match. Doing it at this call site rather than insidegetIOUActionForTransactionIDavoids touching its ~15 other callers.childReportID. In the same function, treatnewIOUAction.childReportIDas absent when no report exists for it in Onyx, so a fresh transaction thread is built (Transaction.ts:1594-1600). This also protects every other move path from a stale thread ID.originalMessage.IOUTransactionIDso only one action ever claims a transaction.Fixes 1 and 2 are independently sufficient for this repro; 3 stops the duplicate from existing at all.
What alternative solutions did you explore?
shouldRemoveIOUTransaction: true). Rejected — that flag exists so the Search "Deleted" filter and Undelete can still find the transaction.ChangeTransactionsReportrejecting the move server-side. I could not verify the backend contract from this repo. If the client fixes above don't resolve it, an internal engineer should confirm the backend accepts a move for a just-undeleted transaction — that part is outside Expensify/App.Live repro attempt (did not reproduce on latest main) and confidence
I ran the exact steps on web against
main(0498f1e) and the move worked: the RHP rendered the moved expense and opening it from the workspace chat showed no infinite loading.This is consistent with the root cause rather than contradicting it. In my run, Undelete surfaced a newly created Self DM report —
changeTransactionsReportcreates one whenSELF_DM_REPORT_IDisn't set (Transaction.ts:941-1021) — so the restored expense landed in a Self DM that contained no stale action, and step 3 above found the correct action. That matches the issue's stated prerequisite ("Account has Self DM"): the bug needs the undeleted expense to return to the same Self DM that still holds the blanked action.The guard at
Transaction.ts:1098-1104was already present on 3 Aug 2026 (6a94d7f), andgetIOUActionForTransactionIDstill has no deleted-action filter onmain, so nothing has fixed this since the report.Confidence: Medium. Every step of the chain has file:line evidence, but I have no production log or live repro confirming which of the two actions
.find()returns in the failing case. To confirm, capture the Self DM'sreportActionsafter delete → undelete and check for twoIOUactions with the sameIOUTransactionID, then check whether the moved expense'schildReportIDmatches the pre-delete thread ID.I did not find an existing open issue covering this.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/97677)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Sep 5, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (
External)melvin-bot commentedon Sep 5, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 9, 2026
@situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!
62 remaining items
melvin-bot commentedon Oct 6, 2026
Payment Summary
Resolving PRs:
fix Expense - Unable to move undeleted expense to workspace #102317
Reviewer: @situchan owed $175 via NewDot
Assignee: @samarroy84 requires payment (Needs manual offer from BZ)
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Oct 9, 2026
Payment Summary
Contributor: @samarroy84 paid $250 via Upwork
Contributor+: @situchan due $250 via NewDot
@samarroy84 can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022108386982186092795
melvin-bot commentedon Oct 15, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Oct 16, 2026
@samarroy84 paid, summary updated above. Thx.
Plz comment and tag me once you accept so I can pay promptly
trjExpensify commentedon Nov 3, 2026
approved $250 for @situchan