[$175] [Exploratory] iOS Hold - Expense details are not displayed when partially approve
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.43-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/84823078/folder/13176872/41237335/1995465055 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iphone 11/26.2 App Component: Other
Action Performed:
Precondition: Admin create workspace and invite employee and approver
Steps:
- As employee submit two expenses to workspace chat
- As approver open the expense report but do not open expense thread
- As approver select one of the expenses and hold
- As approve partially approve the report
Expected Result:
Expense details page should be displayed
Actual Result:
Receipt, Amount, Merchant, Category, Description, Date fields are not displayed
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [x] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [ ] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/ef89559a-5d87-49b4-a256-854f1a6bd87a
Applause Internal Information Exported by: Chandana Kiran Bug ID: 7319583
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022124889632366026491
- Upwork Job ID: 2124889632366026491
- Last Price Increase: 2026-11-23
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/b12ea27e9b096b9ea2d4901ef6a4b14f5bdbb730d105e8f7df482a94a3358855
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (External)
Job added to Upwork: https://www.upwork.com/jobs/~022124889632366026491
⚠️ Preliminary analysis (low confidence) — the code supports a missing-thread-data explanation, but the reported failure is not confirmed.
Suspected cause
Partial approval moves the held expense into a separate report, leaving one approved expense on the original report. The UI then switches to single-expense rendering, which requires the expense’s thread report to be loaded locally.
If that thread is unavailable, the UI skips the entire expense-details component. This explains why Receipt, Amount, Merchant, Category, Description, and Date could disappear together—without those values being deleted.
Code evidence and alternative explanations
- Partial approval invokes the held-expense split: ReportWorkflow.ts:436–474.
- The split moves held transactions and reparents threads only when available locally: Hold.ts:923–956.
- Without
transactionThreadReport.reportID, the renderer omitsMoneyRequestViewand displays report-level content instead: MoneyReportContentCreated.tsx:56–96.
Counterevidence: A parent-report refetch already exists when a valid thread ID becomes available: ReportFetchHandler.tsx:466–483. Whether that response fails to hydrate the thread is unknown. Incomplete parent/action linkage or a server-response omission remain alternatives.
These references describe the inspected checkout, not independently verified source for version 9.5.43-0.
What must be confirmed
Capture the remaining expense’s thread report and parent/action linkage before and after partial approval, together with the approval and subsequent report-open responses. This will establish whether the problem is missing client hydration, incomplete linkage, or missing server data. A specific fix is premature without that evidence.
Production verification was blocked because log tools were unavailable.
Web verification results
🤖 Web test steps verification results: ❌ fail
The scenario requires separate employee and approver accounts, but only one pinned session was available. Execution was blocked before setup; this is not a confirmed product failure.
| Step | Status |
|---|---|
Employee submission, approver hold and partial approval, and resulting expense detailsBlocked by the two-account requirement; none of the workflow assertions were verified. |
❌ |
Preserve never-opened expense threadsNo expense threads were opened, but preservation throughout the workflow could not be verified. |
❌ |
Possibly related
Approved expense shown on same report as a held one after approving involves the same partial-approval transition, but reports a different symptom and is not a confirmed duplicate.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS (narrow layout), when an approver opens a submitted 2-expense report without opening either expense thread, puts one of the expenses on hold, and partially approves the report, the remaining single approved expense does not display its expense details (Receipt, Amount, Merchant, Category, Description, Date). Only the report header and the submitted / approved actions are shown.
What is the root cause of that problem?
Two compounding bugs in src/pages/inbox/ReportFetchHandler.tsx break transaction-thread creation when a 2-expense report is reduced to a single expense via partial approval on narrow screens (MoneyRequestReportPreview/index.tsx:207-208 opens ROUTES.REPORT_WITH_ID → ReportScreen → ReportFetchHandler on small screens, whereas wide screens open SearchMoneyRequestReportPage, which already avoids both bugs):
- Unopened expenses have no transaction thread yet:
useRequestMoneySubmission.ts:56(andIOUAmountSubmission.ts:449) submits expenses withshouldGenerateTransactionThreadReport = false. Putting the first expense on hold viaputOnHold(Hold.ts:99-102, 236-266) creates a thread only for that held expense, so the remaining unheld expense'sIOUaction still haschildReportID === undefined. - Stale transaction selection in
createOneTransactionThread(ReportFetchHandler.tsx:159, 271-290): Partial approval (ReportWorkflow.ts:441-474→getReportFromHoldRequestsOnyxDatainHold.ts:986-1005) marks the held expense'sIOUaction deleted inONYXKEYS.COLLECTION.REPORT_ACTIONS<reportID>and moves the held transaction'sreportIDinONYXKEYS.COLLECTION.TRANSACTION. BecauseuseReportTransactionsCollectionreads the derived keyONYXKEYS.DERIVED.REPORT_TRANSACTIONS_AND_VIOLATIONSwhose recompute is flushed asynchronously viaqueueMicrotask(OnyxDerived/index.ts:278),ReportFetchHandlerrenders with the deletedIOUaction inreportActionswhilereportTransactionsCollectionstill holds both[heldTransaction, remainingTransaction]:- Lines
161-165correctly filter out the held expense viagetAllNonDeletedTransactions(...), sovisibleTransactionscontains only the remaining unheld expense andgetOneTransactionThreadReportIDreturnsCONST.FAKE_REPORT_ID('0'). - That triggers
createOneTransactionThread()(ReportFetchHandler.tsx:428-438). However,createOneTransactionThreadignoresvisibleTransactionsand instead reads the unfilteredreportTransactionsCollection(line272), filtering onlypendingAction !== DELETE— which does not exclude the held expense (it was moved, not deleted). - Consequently,
currentReportTransactions.at(0)picks the held expense instead of the remaining unheld expense,getIOUActionForReportID(reportID, oneTransactionID)resolves its deletedIOUaction, andcreateTransactionThreadReportattaches the new thread to that deleted action instead of the remaining expense's liveIOUaction.
- Lines
- Missing dependency prevents recovery (
ReportFetchHandler.tsx:428-438): OnceREPORT_TRANSACTIONS_AND_VIOLATIONSfinishes recomputing and removes the held transaction, the effect's dependency array ([reportLoadingState.hasOnceLoadedReportActions, reportMetadata?.isOptimisticReport, transactionThreadReport?.reportID, transactionThreadReportID, isOffline]) does not includeoneTransactionID(unlikeSearchMoneyRequestReportPage.tsx:252, fixed in #80107). BecausetransactionThreadReportIDstaysCONST.FAKE_REPORT_IDandtransactionThreadReport?.reportIDstaysundefined, the effect never re-runs.
Without transactionThreadReport?.reportID, MoneyReportContentCreated.tsx:58-97 stays permanently in its !hasThread branch — omitting <MoneyRequestView> and rendering only <MoneyReportView>, which hides report-level totals/breakdowns on a single-expense report (MoneyReportView.tsx:109-116, 245).
What changes do you think we should make in order to solve the problem?
In src/pages/inbox/ReportFetchHandler.tsx:
- Derive the single remaining transaction and live
IOUaction from the already-filtered data instead of reading rawreportTransactionsCollection:- Remove the redundant
reportTransactionsCollectionsubscription (line159). - Resolve the single live
IOUaction viagetOneTransactionThreadReportAction(report, chatReport, reportActions ?? [], isOffline, reportTransactionIDs)(usinggetTransactionThreadReportIDFromActionfortransactionThreadReportID) — or deriveoneTransactionfrom the non-deleted, non-pending-deletereportTransactions(matchingvisibleTransactionsonline and also excludingpendingAction === DELETEoffline) and look up its live action withgetIOUActionForTransactionID(reportActions, oneTransactionID, true). - Guard inside the
FAKE_REPORT_IDeffect /createOneTransactionThreadsocreateTransactionThreadReportis only invoked when bothoneTransactionand its liveiouActionare defined, preventing accidental orphan-thread creation during transient renders.
- Remove the redundant
- Include
oneTransactionID(andiouAction?.reportActionID) in theuseEffectdependency array at lines428-438(mirroringSearchMoneyRequestReportPage.tsx:252from #80107) so that if the remaining transaction resolves aftertransactionThreadReportIDfirst becomesCONST.FAKE_REPORT_ID, the effect reliably re-runs and creates the thread for the remaining expense. - Add regression tests in
tests/unit/ReportFetchHandlerTest.tsxcovering:- A 2-expense report where the first expense's
IOUaction is marked deleted (partial approval) whileREPORT_TRANSACTIONS_AND_VIOLATIONSstill transiently contains both transactions — verifyingcreateTransactionThreadReportis called with the remaining second expense and its liveIOUaction (not the held/deleted first expense). - A transient render where
visibleTransactionsis empty whentransactionThreadReportID === CONST.FAKE_REPORT_ID, followed by the remaining transaction arriving — verifying no broken thread is created while empty and the thread is created onceoneTransactionIDresolves.
- A 2-expense report where the first expense's
What alternative solutions did you explore? (Optional)
- Calling
openReporton the parent report again whentransactionThreadReportID === CONST.FAKE_REPORT_ID: Does not resolve the issue because the unheld expense was created withshouldGenerateTransactionThreadReport = falseand never opened, so the server has nochildReportIDfor it untilcreateTransactionThreadReportcreates one. - Forcing thread creation in
Hold.ts(getReportFromHoldRequestsOnyxData) for remaining unheld expenses: Overly coupled to partial approval and would miss other flows onReportScreenthat reduce a multi-expense report to one expense (e.g., deleting or moving an expense whileREPORT_TRANSACTIONS_AND_VIOLATIONSlags behindREPORT_ACTIONS). FixingReportFetchHandler.tsxresolves partial approval and all analogous single-expense transitions uniformly.
@rojiphil Whoops! This issue is 2 days overdue. Let's get this updated quick!
@rojiphil 6 days overdue. This is scarier than being forced to listen to Vogon poetry!