You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spend - RHP loads infinitelly after merging Self DM expense with workspace expense offline. #92846
Version Number: 9.4.0.0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#89360 Email or phone of affected tester (no customers):ibellicotest+2766@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Search
Action Performed:
Prerequisite: Account has Self DM.
Prerequisite 2: Account has at least one workspace.
Open the staging.new.expensify.com website.
Create an expense in self DM.
Create an expense in workspace chat.
Go to Spend > Expenses.
Turn off internet connection.
Select the workspace expense via the checkbox.
Click the dropdown button > Merge.
Select self DM expense > Continue.
Select the second option in each section > Next > Merge expenses.
Note that infinite loading is displayed when RHP is opened.
Expected Result:
After meging expense from Self DM with workspace expense while on "Spend", user should automatically land on transaction thread.
Actual Result:
After merging expense from Self DM with workspace expense while on "Expenses" section on "Spend", RHP is displayed with infinite loading.
👋 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:
Identify the pull request that introduced this issue and revert it.
Find someone who can quickly fix the issue.
Fix the issue yourself.
godzillaxbox19982014-lgtm commented on Jun 6, 2026
The local evidence matches this recurring failure shape: optimistic transaction/report data is written to one Onyx key but the visible list reads another derived key. Here, src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:219 and src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:195 do not agree on the same workspace name, expense report, DM value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.
What changes do you think we should make in order to solve the problem?
Update src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:219 to derive workspace name, expense report, DM from the report/transaction source that owns this flow before the value is consumed.
Carry the same normalized value through src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:195; that follows the safer family move to align optimistic/success/failure data with the selector consumed by the screen, so the write/optimistic/read paths agree instead of only changing the visible component.
Keep the change inside the Reports, Expenses, IOU, Transactions surface and avoid changing payment actions, personal/deleted policies.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add or update a regression in tests/unit/ReportUtils*.ts for the exact issue flow: Spend - RHP loads infinitelly after merging Self DM expense with workspace expense offline..
Cover the counter-case near src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:219 so valid existing workspace name, expense report, DM behavior still works.
Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.
What alternative solutions did you explore? (Optional)
I would not add a broad new condition outside these referenced paths; the safer fix is to keep workspace name, expense report, DM consistent at the first read/write boundary shown above.
🤖 Automated analysis — high confidence. This is a regression from PR #89360 (in the current staging deploy), which is why it reproduces in staging but not production.
Please re-state the problem that we are trying to solve in this issue.
When merging a Self DM expense with a workspace expense while offline from Reports > Expenses (Spend), the RHP that opens after the merge shows an infinite loading skeleton instead of landing on the transaction thread.
What is the root cause of that problem?
PR #89360 changed the post-merge navigation target. The app now navigates to the target transaction's thread report instead of the destination chat report:
That thread report exists in Onyx (the merge reparents it), but its REPORT_ACTIONS_<id> collection is empty — no OpenReport was ever called for it, and mergeTransactionRequest does not seed an optimistic CREATED action for it. When the RHP mounts, ReportFetchHandler fires OpenReport, which optimistically sits in the persisted request queue and never completes offline.
The infinite skeleton then comes from this offline-only footer condition:
With no report actions loaded, there is no CREATED action, so offline this stays true forever and the skeleton is the entire visible content. Before the PR, navigation went to the destination chat report (e.g. self DM / workspace chat), which already had its CREATED action in Onyx, so the skeleton never showed offline.
OpenReport metadata lifecycle (optimistic true, cleared only on success/failure): Report/index.ts:1494-1567
mergeTransactionRequest reparents the thread report but writes no CREATED action into REPORT_ACTIONS_<threadReportID>: MergeTransaction.ts:647-734
Note: isLoadingInitialReportActions is not the cause — every check of it in ReportActionsView.tsx is gated on !isOffline. The freeze is specifically the isOffline && !some(CREATED) footer skeleton.
What changes do you think we should make in order to solve the problem?
Recommended (targeted): in ConfirmationPage.tsx, only navigate to the transaction thread when its report actions are actually available; otherwise fall back to the destination report (reportIDToDismiss), preserving the pre-PR offline behavior. Concretely, when isOffline (or when REPORT_ACTIONS_<targetTransactionThreadReportID> has no CREATED action), set searchReportIDToOpen = reportIDToDismiss.
Alternative: seed an optimistic CREATED report action into REPORT_ACTIONS_<targetTransactionThreadReportID> inside mergeTransactionRequest when the thread is reparented, so the offline skeleton condition is satisfied and the thread renders immediately.
Because this is a DeployBlockerCash, reverting PR #89360 is a valid fast path if a targeted fix can't be verified offline quickly.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/92846) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
The offending PR is #89360 — "Fix bulk expense merge opening self DM instead of transaction thread" (author marufsharifi, merged 2026-06-04, currently in the staging deploy — which is why this reproduces in staging but not production).
Why it's the cause: That PR changed the post-merge navigation target to the target transaction's thread report instead of the destination chat report (ConfirmationPage.tsx — targetTransactionThreadReportID = mergeTransaction?.targetTransactionThreadReportID ?? getTransactionThreadReportID(targetTransaction)). Offline, that thread report has no CREATED action loaded, so the offline-only skeleton condition in ReportActionsList.tsx:628 (isOffline && !some(action === CREATED)) stays true forever → infinite skeleton.
Verification
PR title and scope match exactly: it touches ConfirmationPage.tsx, MergeTransactionUtils.ts, and MergeTransaction.ts — the precise files in the merge-navigation flow.
The navigation behavior change is in the diff: getTransactionThreadReportID(targetTransaction) → mergeTransaction?.targetTransactionThreadReportID ?? getTransactionThreadReportID(targetTransaction).
Regression timeline is consistent: merged 2026-06-04, reported 2026-06-06, staging-only.
Since this is a DeployBlockerCash, reverting #89360 is the fast path; the targeted fix (fall back to the destination report when offline / when the thread has no CREATED action) is described in the proposal above.
Activity
applause-bot commentedon Jun 6, 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/26b60b8eb1d62b0050c78b6fae37ace45070ecafacd480b72ccb0ca9e3b98a4c
melvin-bot commentedon Jun 6, 2026
@MonilBhavsar recently merged #89360, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Jun 6, 2026
Triggered auto assignment to @NicolasBonet (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jun 6, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 6, 2026
👋 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:
godzillaxbox19982014-lgtm commentedon Jun 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Spend - RHP loads infinitelly after merging Self DM expense with workspace expense offline.
What is the root cause of that problem?
I traced this to the path that handles
workspace name, expense report, DM:existingInvoiceReport):const existingInvoiceReport = useParticipantsInvoiceReport(receiverAccountID, receiverType, senderWorkspaceID);hasViolations):const hasViolations = hasViolationsReportUtils(report?.reportID, transactionViolations, currentUserPersonalDetails.accountID, currentUserPersonalDetails.login ?? '');senderWorkspaceID):const senderWorkspaceID = transaction?.participants?.find((p) => p?.isSender)?.policyID;src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:219andsrc/pages/iou/request/step/confirmation/useExpenseSubmission.ts:195do not agree on the sameworkspace name, expense report, DMvalue, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.What changes do you think we should make in order to solve the problem?
src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:219to deriveworkspace name, expense report, DMfrom the report/transaction source that owns this flow before the value is consumed.src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:195; that follows the safer family move to align optimistic/success/failure data with the selector consumed by the screen, so the write/optimistic/read paths agree instead of only changing the visible component.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
tests/unit/ReportUtils*.tsfor the exact issue flow: Spend - RHP loads infinitelly after merging Self DM expense with workspace expense offline..src/pages/iou/request/step/confirmation/useExpenseSubmission.ts:219so valid existingworkspace name, expense report, DMbehavior still works.What alternative solutions did you explore? (Optional)
workspace name, expense report, DMconsistent at the first read/write boundary shown above.MelvinBot commentedon Jun 6, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When merging a Self DM expense with a workspace expense while offline from
Reports > Expenses(Spend), the RHP that opens after the merge shows an infinite loading skeleton instead of landing on the transaction thread.What is the root cause of that problem?
PR #89360 changed the post-merge navigation target. The app now navigates to the target transaction's thread report instead of the destination chat report:
That thread report exists in Onyx (the merge reparents it), but its
REPORT_ACTIONS_<id>collection is empty — noOpenReportwas ever called for it, andmergeTransactionRequestdoes not seed an optimisticCREATEDaction for it. When the RHP mounts,ReportFetchHandlerfiresOpenReport, which optimistically sits in the persisted request queue and never completes offline.The infinite skeleton then comes from this offline-only footer condition:
With no report actions loaded, there is no
CREATEDaction, so offline this staystrueforever and the skeleton is the entire visible content. Before the PR, navigation went to the destination chat report (e.g. self DM / workspace chat), which already had itsCREATEDaction in Onyx, so the skeleton never showed offline.Evidence chain (file:line)
ConfirmationPage.tsx:59and:97-103MergeTransactionUtils.ts:354-393ReportActionsList.tsx:628-636OpenReportmetadata lifecycle (optimistictrue, cleared only on success/failure):Report/index.ts:1494-1567mergeTransactionRequestreparents the thread report but writes noCREATEDaction intoREPORT_ACTIONS_<threadReportID>:MergeTransaction.ts:647-734Note:
isLoadingInitialReportActionsis not the cause — every check of it inReportActionsView.tsxis gated on!isOffline. The freeze is specifically theisOffline && !some(CREATED)footer skeleton.What changes do you think we should make in order to solve the problem?
Recommended (targeted): in
ConfirmationPage.tsx, only navigate to the transaction thread when its report actions are actually available; otherwise fall back to the destination report (reportIDToDismiss), preserving the pre-PR offline behavior. Concretely, whenisOffline(or whenREPORT_ACTIONS_<targetTransactionThreadReportID>has noCREATEDaction), setsearchReportIDToOpen = reportIDToDismiss.Alternative: seed an optimistic
CREATEDreport action intoREPORT_ACTIONS_<targetTransactionThreadReportID>insidemergeTransactionRequestwhen the thread is reparented, so the offline skeleton condition is satisfied and the thread renders immediately.Because this is a
DeployBlockerCash, reverting PR #89360 is a valid fast path if a targeted fix can't be verified offline quickly.Related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92846)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
NicolasBonet commentedon Jun 8, 2026
@MelvinBot can you find the offending PR?
MelvinBot commentedon Jun 8, 2026
The offending PR is #89360 — "Fix bulk expense merge opening self DM instead of transaction thread" (author
marufsharifi, merged 2026-06-04, currently in the staging deploy — which is why this reproduces in staging but not production).Why it's the cause: That PR changed the post-merge navigation target to the target transaction's thread report instead of the destination chat report (
ConfirmationPage.tsx—targetTransactionThreadReportID = mergeTransaction?.targetTransactionThreadReportID ?? getTransactionThreadReportID(targetTransaction)). Offline, that thread report has noCREATEDaction loaded, so the offline-only skeleton condition inReportActionsList.tsx:628(isOffline && !some(action === CREATED)) staystrueforever → infinite skeleton.Verification
ConfirmationPage.tsx,MergeTransactionUtils.ts, andMergeTransaction.ts— the precise files in the merge-navigation flow.getTransactionThreadReportID(targetTransaction)→mergeTransaction?.targetTransactionThreadReportID ?? getTransactionThreadReportID(targetTransaction).melvin-botauto-assignment flaggedMonilBhavsar's merge of Fix bulk expense merge opening self DM instead of transaction thread #89360, and the BrowserStack field links the same PR).Since this is a
DeployBlockerCash, reverting #89360 is the fast path; the targeted fix (fall back to the destination report when offline / when the thread has noCREATEDaction) is described in the proposal above.NicolasBonet commentedon Jun 8, 2026
@MelvinBot let's create a revert PR
MelvinBot commentedon Jun 8, 2026
🤖 Draft revert PR created: #92934
This is a clean revert of merge commit
e07b8f42a1c4d2db5960827786baea87ba4d4390(git revert -m 1) — 15 files changed, matching #89360's footprint.Local AI tests (all passed):
npm run typecheck✅npm run lint-changed✅npm teston the merge-transaction suites (MergeTransactionTest,MergeTransactionUtilsTest,useSelectedTransactionsActions.test) ✅ — 119 tests passedPlease fill out the human-only Tests / QA sections and mark it "Ready for review" when ready.
NicolasBonet commentedon Jun 8, 2026
PR reverted, waiting for staging deployment
m-natarajan commentedon Jun 8, 2026
Reproduced, Chrome / v9.4.0-2 (Waiting for Android validation)
REC-20260608211901.mp4
m-natarajan commentedon Jun 8, 2026
Not reproduced, Chrome / v9.4.0-4 , Xiaomi Redmi Note 10 / Android 12
REC-20260608223444.mp4
Screenrecorder-2026-06-08-22-47-55-46.mp4
NicolasBonet commentedon Jun 8, 2026
Thank you! That solves the issue.