App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-12-08] [$175] Missing 'More' button after create an Invoice and tap 'View' button

Open applause-bot[bot] opened this issue 1 week ago • 15 comments

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.51-1-staging 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/tc/TC-762083 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 iOS 18.7.1 Safari / Pixel 7 pro Android 16 Chrome App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Confirm your Workspace has 'Invoices' enabled 3.Navigate to 'Spend' tab and tap on FAB '+'
  3. Tap 'Send invoice'
  4. Insert any amount and tap on 'Next'
  5. Select a Destination and tap on 'Next'
  6. Confirm 'Send the invoice'
  7. Tap on displayed bar 'View' at top

Expected Result:

The 'More' button should be available above Invoice header

Actual Result:

The 'More' button does not render when navigated to a just created Invoice from 'View'

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [x] Android: mWeb Chrome
  • [x] iOS: App
  • [x] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/f1b75d7a-a4b7-4503-b255-79d008b10e8b

View all open jobs on GitHub

Applause Internal Information Exported by: Alberto Gutierrez Bug ID: 7320318

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @cretadn22

applause-bot[bot] avatar Nov 21 '26 21:11 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/d86d8ebfb52d696a1185e55e3cb532266c79b97526130adc47f5d2d2bbcf2b02

applause-bot[bot] avatar Nov 21 '26 21:11 applause-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @cretadn22 (External)

Job added to Upwork: https://www.upwork.com/jobs/~022124249823569603350

🤖 Web test steps verification results: ⚠️ partial

Verified dev NewDot web through entering $1 and advancing to destination selection. Blocked by an empty recipient picker and no supplied destination fixture; this issue was not reproduced or disproved.

Invoice destination picker without selectable recipients
Step Status
Open appSigned in successfully; onboarding was complete.
✅
Confirm workspace has Invoices enabledCreated a test workspace and enabled Invoices.
✅
Spend → + → Send invoice → amount → NextEntered $1 and reached destination selection.
✅
Select destination and send invoiceBlocked: no selectable recipients or Next button appeared. This is a testing blocker, not confirmation of the reported bug.
Invoice destination picker without selectable recipients
❌
Click View; inspect More and navigationNot reached.

Preliminary analysis — low confidence: View initially opens the invoice’s child transaction thread through navigateToCreatedExpense.ts:68–79. That thread uses the generic header rather than the invoice’s action header, explaining how an invoice-looking screen can lack More: ReportHeader.tsx:75–117.

Counterevidence: An existing single-transaction redirect should replace that thread with the parent invoice report. Therefore, opening the thread alone does not establish the root cause. Ordinary invoice permissions are also unlikely: the loaded report always receives View details as a secondary action.

Required confirmation: Capture the final report ID after View and determine whether the redirect completes. If the child thread persists, investigate its parent/action linkage and redirect conditions. No code fix is verified yet; changing permissions or redirect behavior would be premature.
❌

view run · view recording

MelvinBot avatar Nov 21 '26 21:11 MelvinBot

@cretadn22 Melvin's analysis treats the OneTransactionThreadRedirectHandler redirect as counterevidence, but that redirect is skipped here: View seeds the carousel with only the new transactionID and no source, and the Spend list still mounted behind the RHP overwrites any unowned list with its own rows:

https://github.com/Expensify/App/blob/e41949db5a6815138b00e3c3a2e5f753eded5f83/src/libs/Navigation/helpers/navigateToCreatedExpense.ts#L75-L79 https://github.com/Expensify/App/blob/e41949db5a6815138b00e3c3a2e5f753eded5f83/src/libs/actions/TransactionThreadNavigation.ts#L172-L174

With two or more rows on Spend (the video's list has several), isSteppingThroughExpenses becomes true, so the invoice's transaction thread is never replaced and it renders HeaderView, which has no More button. I tested this locally — after View the carousel held the Spend list's IDs and the route stayed on the thread, while with a single row on Spend the redirect fired and More rendered. Opening iouReportID directly from that branch of navigateToCreatedExpense when the report has one transaction, as its wide Inbox branch already does, removes the dependency on the redirect without touching the carousel the other writers share.

Happy to put up a full proposal for this if that's useful.

yusufdeveloper2903 avatar Nov 21 '26 21:11 yusufdeveloper2903

Proposal

Please re-state the problem that you are trying to solve.

Missing 'More' button after create an Invoice and tap 'View' button

What is the root cause of that problem?

Tracing the execution path in the affected component flow, the handler does not properly validate null/undefined state attributes before invoking dispatch, causing an unexpected UI freeze or unhandled state exception.

What changes do you think we should make in order to solve the problem?

  1. In the relevant component / action handler:
    • Add defensive null-safety guards before accessing the target report / state attributes.
    • Ensure the correct parent context or fallback default is resolved when the direct attribute is undefined.
  2. In the corresponding action dispatcher:
    • Validate that payload parameters are properly sanitised before invoking the service call.
    • Handle error states gracefully with appropriate user notification rather than an unhandled UI failure.

What alternative solutions did you explore? (Optional)

Considered a top-level error boundary wrap, but targeting the root trigger handler directly provides an immediate fix with zero regression risk across other platforms.

TassioSales avatar Nov 21 '26 22:11 TassioSales

Proposal

Please re-state the problem that we are trying to solve in this issue.

After creating a new Invoice from the Spend tab and tapping View on the Invoice sent growl notification, the opened invoice view is missing the More button in the header.

What is the root cause of that problem?

Two interacting issues in src/libs/Navigation/helpers/navigateToCreatedExpense.ts prevent the opened Invoice from rendering its report header (MoneyReportHeader, which owns the More button):

  1. Always opening threadReportID instead of iouReportID on Spend (!openOnInbox): In src/libs/Navigation/helpers/navigateToCreatedExpense.ts (lines 75–80), when !openOnInbox is true (user is on the Spend tab), navigateToCreatedExpense unconditionally navigates to ROUTES.SEARCH_REPORT.getRoute({reportID: threadReportID, backTo})—even when iouReportID is present and !hasMultipleReportTransactions (as with a newly created single-transaction Invoice). Because ReportHeader (src/pages/inbox/ReportHeader.tsx, lines 46–105) renders MoneyRequestHeader for a transaction thread and only renders MoneyReportHeader (with the More button) for an expense/invoice report, this branch relies entirely on OneTransactionThreadRedirectHandler (src/pages/inbox/OneTransactionThreadRedirectHandler.tsx, lines 66–105) to replace threadReportID with iouReportID.
  2. Unowned carousel seed gets immediately overwritten by the background Spend list, blocking the redirect: On line 76 of navigateToCreatedExpense.ts, setActiveTransactionIDs([transactionID]) is called without a source option (it is currently the only caller in the codebase that omits source, setting lastSetSource = null). Because the Spend Search screen stays mounted behind the RHP (src/components/Search/index.tsx, lines 945–960) with activeCarouselTransactionIDs in its useEffect dependencies, writing [transactionID] immediately triggers Search's refresh effect. In src/libs/actions/TransactionThreadNavigation.ts (lines 172–174), shouldRefreshActiveTransactionIDs treats lastSetSource === null as unowned and returns true whenever the lists differ, so Search immediately overwrites ONYXKEYS.TRANSACTION_THREAD_NAVIGATION_TRANSACTION_IDS with the Spend list's rows. When Spend has 2 or more rows, isSteppingThroughExpenses (OneTransactionThreadRedirectHandler.tsx, line 83) becomes true, blocking shouldRedirectToParentReport (line 91). The RHP stays stuck on threadReportID (MoneyRequestHeader without More, and with unrelated Spend prev/next arrows).

What changes do you think we should make in order to solve the problem?

  1. Open iouReportID directly for single-transaction reports on Spend (src/libs/Navigation/helpers/navigateToCreatedExpense.ts): In the !openOnInbox branch (lines 75–80), when iouReportID && !hasMultipleReportTransactions, navigate directly to ROUTES.SEARCH_REPORT.getRoute({reportID: iouReportID, backTo}) with {forceReplace}—mirroring the wide-Inbox single-transaction branch (lines 117–124). This renders MoneyReportHeader (including the More button) immediately without depending on OneTransactionThreadRedirectHandler, avoids a redirect hop/flash, and leaves the Spend carousel untouched.
  2. Stamp source ownership on the remaining setActiveTransactionIDs calls in src/libs/Navigation/helpers/navigateToCreatedExpense.ts and src/libs/actions/TransactionThreadNavigation.ts:
    • Add a createdExpense source in CAROUSEL_SOURCE (src/libs/actions/TransactionThreadNavigation.ts) and pass it in the remaining !openOnInbox thread branch (line 76, for tracked/unreported expenses and multi-transaction reports opened from Spend) so Search/index.tsx:954 does not clobber the carousel with unrelated Spend rows (Search cleanly reclaims CAROUSEL_SOURCE.search(hash) on the next row press via seedCarouselForOpenedExpense at line 694).
    • Pass {source: CAROUSEL_SOURCE.report(iouReportID)} on the multi-transaction report seeds at lines 87, 100, and 129 of navigateToCreatedExpense.ts for consistency with useMoneyRequestReportActiveTransactionIDs.
  3. Update and expand unit tests (tests/unit/navigateToCreatedExpenseTest.ts): Update the Spend-tab single-transaction test cases to expect navigation to iouReportID when iouReportID is present and !hasMultipleReportTransactions, while verifying that tracked (iouReportID: undefined) and multi-transaction Spend expenses still open threadReportID with an owned carousel source.

What alternative solutions did you explore? (Optional)

  • Only adding a source to setActiveTransactionIDs([transactionID]) without opening iouReportID directly: That would allow OneTransactionThreadRedirectHandler to redirect, but it still incurs an unnecessary two-step navigation/header flicker (threadReportID → iouReportID) and leaves the single-transaction Spend path inconsistent with the wide-Inbox path (which already opens iouReportID directly).
  • Only opening iouReportID directly without stamping source on the remaining setActiveTransactionIDs calls: That fixes single-transaction invoices/reports, but leaves the unowned-carousel overwrite bug intact for tracked expenses and multi-transaction reports opened via View on Spend. Combining both fixes the reported issue cleanly and eliminates the carousel ownership gap across all navigateToCreatedExpense branches.

danlopes18-ctrl avatar Nov 22 '26 18:11 danlopes18-ctrl

@cretadn22 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@MelvinBot can you make a proposal to fix this issue?

cretadn22 avatar Nov 25 '26 04:11 cretadn22

@cretadn22 I sent you a Slack DM to connect GitHub. I will continue the original request once you are connected.

melvin-bot[bot] avatar Nov 25 '26 04:11 melvin-bot[bot]

Proposal

What is the root cause of that problem?

View opens the invoice’s transaction thread instead of the invoice report. That thread displays a generic header without the invoice’s More menu.

Normally, a redirect corrects this. However, the Spend list can overwrite the newly seeded transaction carousel with its own transactions. When that list contains multiple transactions, the redirect is deliberately skipped, leaving the wrong header displayed.

This supports the mechanism identified by yusufdeveloper2903 and danlopes18-ctrl. One correction: the invoice thread renders HeaderView, not MoneyRequestHeader.

Supporting code evidence

This is verified through code tracing, not a new browser reproduction.

What changes do you think we should make in order to solve the problem?

In the Spend navigation branch, open the parent report directly when it exists and has no multiple active transactions, before seeding the carousel.

Preserve the existing back destination and replacement behavior. Keep transaction-thread navigation unchanged for tracked/unreported expenses and multi-transaction reports.

This removes the invoice’s dependency on the redirect without changing shared carousel behavior, permissions, or headers.

Regression coverage:

  • New single-transaction invoice → View opens the parent invoice and shows More, with both one and multiple Spend transactions.
  • Verify narrow and wide web layouts, including correct back navigation.
  • Confirm tracked expenses and multi-transaction reports retain their existing navigation.

What alternative solutions did you explore? (Optional)

Adding carousel ownership could allow the redirect to complete, but still requires an unnecessary navigation hop and changes shared carousel behavior. Those broader changes are not required for this fix.


Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/107675) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Nov 25 '26 04:11 MelvinBot

@MelvinBot Implement this

cretadn22 avatar Nov 25 '26 04:11 cretadn22

🤖 Web test steps verification results: ⚠️ partial

Implemented in draft PR: Fix missing invoice More menu after Spend View, assigned to cretadn22; all 43,181 Jest tests, lint, typecheck, formatting, spelling, and Storybook smoke checks passed. Browser verification was blocked by an empty invoice recipient picker, so end-to-end fix correctness remains unverified.

Invoice recipient search shows No results found
Step Status
Invoice View opens parent with More when Spend contains multiple expensesBlocked: no selectable invoice recipient; searching Concierge returned “No results found.”
Invoice recipient search shows No results found
❌
Same invoice flow with one Spend expenseNot verified: no invoice could be sent.
❌
Narrow and wide layouts preserve More and correct back navigationNot verified: required parent invoice was unavailable.
❌
Tracked/unreported and multi-transaction report expenses open transaction threads via ViewNot verified: fresh account had no expense fixtures; testing stopped at the invoice setup blocker.
❌

view run · no recording available

MelvinBot avatar Nov 25 '26 05:11 MelvinBot

Triggered auto assignment to @tylerkaraszewski, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@cretadn22

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.56-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/107922

If no regressions arise, payment will be issued on 2026-12-08. :confetti_ball:

The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

melvin-bot[bot] avatar Dec 01 '26 23:12 melvin-bot[bot]