App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Expense - Split preview loads infinitely and opens not here page after reset app

Open applause-bot[bot] opened this issue 3 months ago • 101 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.4.54-2 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/69228694/folder/53757977/41237800/1660994772?sort=-identifier 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: Mac 26.5 / Chrome App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Open 1:1 DM with another user.
  3. Create a split expense.
  4. Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh.
  5. Go back to 1:1 DM with the user.
  6. Open the split preview.

Expected Result:

Split preview will load after reset app.

Actual Result:

Split preview loads infinitely and opens not here page after reset app.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/92f74892-282d-4727-8a01-158bf6affa1b

View all open jobs on GitHub

Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7235699

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

applause-bot[bot] avatar Aug 17 '26 17:08 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/9a9f2caa75c3e5a2c64d21e32cdeeae61b6a80d22c3e8d10837a5764ad228fa8

applause-bot[bot] avatar Aug 17 '26 17:08 applause-bot[bot]

Proposal

⚠️ Medium confidence. The code mechanism below is well-supported, but I was not able to reproduce the failure in a fresh dev/web session — after Reset and refresh the split preview showed a brief loading skeleton and then opened correctly, no "not here" page. That points to this being timing/data-dependent (a re-hydration race), and the deciding factor lives on the backend. See the reproduction note and next steps before treating the fix as final.

What is the root cause of that problem?

A split preview in a 1:1 DM is not a normal transaction-thread report. Tapping it routes to the Split Bill Details modal (ChatTransactionPreview.tsx:69-70), which renders DynamicSplitBillDetailsPage. That page reads the split's group transaction by IOUTransactionID and shows the "not here" FullPageNotFoundView whenever that transaction is empty (DynamicSplitBillDetailsPage.tsx:146).

The problem is that this group transaction is created client-side parented to a placeholder report ID of -2 ("deleted") — Split.ts:544-549, CONST.REPORT.SPLIT_REPORT_ID = '-2'. It has no real, fetchable owning report. After Clear cache and restart, OpenReport for the DM re-hydrates the chat and its report actions (including the split action), but the page never issues a dedicated fetch for that standalone transaction — the wrapping HOC only calls openReport for the DM (withReportAndReportActionOrNotFound.tsx:77).

So the two observed phases are:

  1. "Loads infinitely" — the FullscreenLoadingIndicator shown while the DM's report actions are still empty (withReportAndReportActionOrNotFound.tsx:83-88).
  2. "Not here" — once the report action arrives but the -2 group transaction has not been re-hydrated, isEmptyObject(transaction) is true → FullPageNotFoundView.

Whether step 2 fires comes down to whether the backend returns the split's -2 group transaction alongside the DM's data. When it does (as in my repro, after the skeleton settled), the page opens fine; when it doesn't (or is slow), you get the not-here page. That backend behavior is in Auth/Web-Expensify's OpenReport, outside this repo — so I can't confirm it here.

Investigation details, reproduction note & alternatives considered

Reproduction (web): Created a €25 manual split in a fresh 1:1 DM, did Troubleshoot > Clear cache and restart > Reset and refresh, returned to the DM. Previews sat in a loading skeleton for ~7s, then opening the split navigated to the full expense detail correctly — no not-here page. This suggests the failure is intermittent and depends on the backend re-hydration of the -2 transaction (a race), which is consistent with it being reproducible in staging/prod but not always locally.

Note on surface: The reporter describes a "transaction thread report", but for a DM split the tapped surface is the Split Bill Details RHP, not ReportScreen. If in the real repro a report-preview (not the split preview) was tapped that navigates to an optimistic one-on-one IOU report with a client-generated reportID, that ID would also be lost after cache clear and produce the same infinite-skeleton → not-found on ReportScreen. Worth confirming from the attached video which card was tapped.

Alternatives considered: (a) The ReportScreen/ReportNotFoundGuard path — ruled out for the split preview because splits always take the SPLIT_BILL_DETAILS branch. (b) A truly stuck OpenReport — unlikely, since openReport flips isLoadingInitialReportActions to false on both success and failure.

Both a code researcher and a second independent researcher converged on this same mechanism with file-level evidence.

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

Make DynamicSplitBillDetailsPage resilient to the group transaction not being present in local cache, rather than immediately falling to "not here":

  • While the DM/report actions are still loading, keep showing the loading state (don't flip to FullPageNotFoundView) until the split transaction has had a chance to hydrate.
  • If the split's group transaction is genuinely not returned by the backend on re-fetch, add an explicit fetch for it (or include it in the DM's OpenReport payload) so the details page can recover it after a cache clear — instead of depending on it being incidentally present in Onyx.

Before writing the fix, confirm the backend behavior with logs (see below) — if OpenReport for the DM simply never returns the -2 split transaction, the durable fix requires a backend change and the App-side change is only a graceful-loading improvement.

What alternative solutions did you explore? (Optional)

Persisting the minimal preview data needed by the details page inside the split report action's originalMessage (so it doesn't depend on a separately-fetched transaction at all).


Possibly related: Expensify/App#92466 — "First split after create expense from FAB open not here page RHP" (open) also involves a split leading to a "not here" page; may share the missing-transaction root cause.

This needs one log confirmation to reach high confidence: for the reproduced flow, whether OpenReport for the DM report returns a TRANSACTION entry for the split action's IOUTransactionID (the -2-parented group transaction) after a cache clear. If it's absent, that's the definitive root cause and the durable fix is backend-side.


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

MelvinBot avatar Aug 17 '26 17:08 MelvinBot

Evidence (web reproduction attempt)

The split preview did not reproduce the failure in a fresh dev session — after Reset and refresh the previews showed a brief loading skeleton (~7s) then opened correctly. Screenshots below.

Split expense preview visible in DM chat before reset

Split expense preview visible in DM chat before reset

DM after cache reset showing preview cards still in loading-skeleton state

DM after cache reset showing preview cards still in loading-skeleton state

Split expense detail view opened successfully after tapping the preview post-reset

Split expense detail view opened successfully after tapping the preview post-reset

DM chat after navigating back, both preview cards fully hydrated

DM chat after navigating back, both preview cards fully hydrated

MelvinBot avatar Aug 17 '26 17:08 MelvinBot

Melvin's root cause is right — the split's container transaction lives on SPLIT_REPORT_ID (-2) and nothing re-fetches it after a cache clear — but the fix is scoped to DynamicSplitBillDetailsPage, and the "loads infinitely" half of this bug is not on that page. The preview card's spinner is driven by shouldShowSkeleton, a plain isEmptyObject(transaction) check with no timeout and no error state:

https://github.com/Expensify/App/blob/d4929738f2cbd2cc940b4cd71330bfaba7e034f3/src/libs/TransactionPreviewUtils.ts#L452

So when the container transaction is missing, the split card in the DM keeps rendering TransactionPreviewSkeletonView forever, and holding the details page in a loading state instead of FullPageNotFoundView only converts the "not here" page into a second permanent spinner.

yusufdeveloper2903 avatar Aug 20 '26 10:08 yusufdeveloper2903

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

melvin-bot[bot] avatar Aug 20 '26 21:08 melvin-bot[bot]

Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] avatar Aug 24 '26 21:08 melvin-bot[bot]

8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

melvin-bot[bot] avatar Aug 26 '26 21:08 melvin-bot[bot]

10 days overdue. Is anyone even seeing these? Hello?

melvin-bot[bot] avatar Aug 28 '26 21:08 melvin-bot[bot]

this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Aug 31 '26 21:08 melvin-bot[bot]

This issue has not been updated in over 14 days. eroding to Weekly issue.

melvin-bot[bot] avatar Sep 02 '26 23:09 melvin-bot[bot]

Proposal

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

After resetting the app cache via Troubleshoot > Clear cache and restart, split expense preview cards in a 1:1 DM display an infinite loading skeleton. Clicking on the preview opens the "Not Here" page (FullPageNotFoundView).

What is the root cause of that problem?

Split container transactions are created client-side parented to CONST.REPORT.SPLIT_REPORT_ID = '-2'. When the cache is cleared, OpenReport fetches the DM report and its report actions, but does not re-hydrate the standalone split group transaction parented to -2.

  1. In TransactionPreviewUtils.ts, shouldShowSkeleton evaluates to true whenever isEmptyObject(transaction) is true without taking report action loading state into account, leaving the preview card stuck in TransactionPreviewSkeletonView.
  2. In DynamicSplitBillDetailsPage.tsx, the component checks isEmptyObject(transaction) and immediately renders FullPageNotFoundView because the transaction is absent from Onyx.

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

  1. Frontend Fallback & Guard:
    • In TransactionPreviewUtils.ts, refine shouldShowSkeleton so that it checks if the parent report's initial actions have completed loading (!isLoadingInitialReportActions). If loading has completed and the transaction is still not in Onyx, fallback to rendering the basic action data from action.originalMessage instead of showing an infinite skeleton.
    • In DynamicSplitBillDetailsPage.tsx, avoid immediately rendering FullPageNotFoundView while report data may still be resolving. If the transaction cannot be found after settlement, provide an appropriate loading or retry state rather than an immediate not-found crash.
  2. Backend Payload Resolution (Internal Coordination):
    • Ensure the OpenReport command for the chat report returns the associated IOUTransactionID for split actions in the response payload to re-hydrate the -2 group transaction in Onyx.

What alternative solutions did you explore? (Optional)

Decoupling the split preview display entirely from standalone transaction hydration by persisting and reading all required preview metadata directly from reportAction.originalMessage.

ravindulakshanabey999 avatar Sep 10 '26 07:09 ravindulakshanabey999

📣 @ravindulakshanabey999! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Sep 10 '26 07:09 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01031ae12d25d4eae5

ravindulakshanabey999 avatar Sep 10 '26 07:09 ravindulakshanabey999

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Sep 10 '26 07:09 melvin-bot[bot]

this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Sep 14 '26 21:09 melvin-bot[bot]

Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Sep 15 '26 21:09 melvin-bot[bot]

6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Sep 17 '26 21:09 melvin-bot[bot]

10 days overdue. I'm getting more depressed than Marvin.

melvin-bot[bot] avatar Sep 21 '26 22:09 melvin-bot[bot]

12 days overdue. Walking. Toward. The. Light...

melvin-bot[bot] avatar Sep 23 '26 21:09 melvin-bot[bot]

Proposal

What is the root cause of that problem?

A 1:1 split preview is not a normal transaction thread. The container transaction is created client-side parented to CONST.REPORT.SPLIT_REPORT_ID ('-2'). After Troubleshoot → Clear cache and restart, OpenReport rehydrates the DM and its report actions, but does not re-fetch that standalone split container transaction.

Two UI failures follow from the empty Onyx transaction:

  1. Infinite skeleton — TransactionPreviewUtils sets shouldShowSkeleton whenever the transaction object is empty, with no tie to “report actions finished loading” and no fallback to data on the split action itself (originalMessage / IOU transaction ID).
  2. “Not here” — DynamicSplitBillDetailsPage renders FullPageNotFoundView as soon as isEmptyObject(transaction) is true, so opening the preview after reset looks like a missing page instead of a still-loading or refetchable split.

So the bug is a rehydration gap for SPLIT_REPORT_ID transactions, surfaced as skeleton forever + immediate not-found — not a deleted chat.

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

  1. Refetch the container transaction when a split preview / split details page has a transaction ID from the report action but Onyx has no transaction after the parent DM’s initial report actions have finished loading (dedicated open/get for that transaction ID, not only OpenReport on the DM).
  2. Skeleton guard in TransactionPreviewUtils: once initial report actions are loaded and the transaction is still missing, stop infinite skeleton — either show a non-spinner fallback from the action payload while refetch runs, or a failed/retry state; do not spin forever on isEmptyObject(transaction) alone.
  3. Details page (DynamicSplitBillDetailsPage): do not jump straight to FullPageNotFoundView on first empty read; wait for the refetch attempt (or explicit settled loading flag), then not-found only if still missing.
  4. Tests covering: cache clear → DM split action present → transaction missing → refetch → preview and details recover; and settled-empty → no infinite skeleton.

Prefer fixing rehydration + loading/settled UI together; UI-only timeouts without refetch would still leave details broken.

What alternative solutions did you explore? (Optional)

  • Stop parenting split containers to '-2' — too large / behavioral; out of scope for this bug.
  • Skeleton timeout only — incomplete; details page would still 404 without a refetch.
  • Backend-only change to embed the container transaction in every DM OpenReport — good complement, but the client still needs settled loading / no infinite skeleton if the payload is delayed or partial.

elecelias-ux avatar Sep 24 '26 07:09 elecelias-ux