Skip to content

[Due for payment 2026-05-07] Spend - Empty state screen displayed for some seconds after splitting an expense. #88954

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.62-5
Reproducible in staging?: Yes
Reproducible in production?: No
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/TR-22585/folder/13176791/41237172/1371128335?q=split&issue_type=jira
#85234
Email or phone of affected tester (no customers): ibellicotest+2250@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: Search

Action Performed:

Prerequisite: Account has at least one workspace.

  1. Open the staging.new.expensify.com website.
  2. Open any workspace chat.
  3. Create a manual expense.
  4. Navigate to "Spend" > "All Expenses"
  5. Select the just created expense.
  6. Click on dropdown menu and select "Split"
  7. Save splits amount.
  8. Note that after returning to "All Expenses", empty state screen appears for some seconds before splits are displayed.

Expected Result:

Splits should appear automatically on "All Expenses" after user splits an expense.

Actual Result:

After splitting an expense while on "All Expenses" on "Spend", empty state screen is displayed for some seconds before the new splits appear.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 27, 2026
  2. melvin-bot commented on Apr 27, 2026

    @melvin-bot

    Triggered auto assignment to @arosiclair (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Apr 27, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 27, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Apr 27, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #85234 - "Introduce a Bottom Tab Navigator for Top-Level Navigation" by @WojtekBoman (High confidence)
    Related Issues: #85260 (original issue this PR fixed)

    Recommendation: REVERT

    PR #85234 introduced a fundamental navigation architecture change (a true createBottomTabNavigator replacing individual root-stack screens). The freezeOnBlur: true and lazy: true options on the new TabNavigator cause the Search tab to get frozen when a modal (the Split expense flow) is pushed onto the root stack. When the user returns to the Search tab ("All Expenses"), the tab briefly unfreezes and re-evaluates its state before the newly-created splits are reflected by Onyx, producing the flash of the empty state.

    Assigned: @WojtekBoman (PR author), @ZhenjaHorbach @mountiny (approving reviewers)
    Labels: DeployBlockerCash kept (frontend bug, no label changes needed — DeployBlocker was not present)

    Detailed Analysis

    Evidence

    Verification

    • Affected area: src/libs/Navigation/AppNavigator/Navigators/SearchFullscreenNavigator.tsx, src/libs/Navigation/AppNavigator/Navigators/TabNavigator.native.tsx, src/libs/Navigation/AppNavigator/FreezeWrapper/index.native.tsx
    • Confirmed PR modifies these files: PR Introduce a Bottom Tab Navigator for Top-Level Navigation #85234 modifies SearchFullscreenNavigator.tsx (changes its parent type from AuthScreensParamList to TabNavigatorParamList and wraps it in FreezeWrapper), introduces TabNavigator.native.tsx with freezeOnBlur: true and lazy: true, and changes FreezeWrapper/index.native.tsx to a no-op (deferring to react-native-screens native freeze).

    Root Cause

    Before PR #85234, the SearchFullscreenNavigator was an independent screen pushed directly onto the root stack. After this PR, it lives as a tab inside a createBottomTabNavigator with freezeOnBlur: true. When a user is on the Search tab and opens the Split expense modal (which pushes onto the root/RightModal stack), the Search tab is no longer "focused" from the tab navigator's perspective. Upon modal dismissal and return to the Search tab, react-native-screens briefly unfreezes the tab, which triggers a re-render of the search page. During this re-render, the Onyx search results have not yet fully updated to reflect the newly-created splits, causing the empty state to appear momentarily before the data hydrates. This race between the tab unfreeze and Onyx data propagation is the root cause of the flash.

  6. MelvinBot commented on Apr 27, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When splitting an expense from the Search "All Expenses" view, the original transaction is optimistically set to null in the search snapshot, but the new split child transactions are not added to the snapshot optimistically. This causes visibleDataLength to drop to 0.

    The empty state guard has protections for other optimistic flows (deferred writes, pending expense placeholders, cached optimistic items), but none of these guards cover the split scenario. When shouldShowEmptyState sees dataLength === 0, the EmptySearchView renders and stays visible until the server responds with fresh search results containing the split children.

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

    Add the split child transactions to the search snapshot optimistically in Split.ts, alongside the existing code that nulls out the original transaction. The optimistic data for the snapshot should include entries for each new split child transaction so the snapshot never becomes empty. This mirrors the pattern already used for other optimistic flows like expense creation.

    If adding optimistic child transactions to the snapshot is too complex (because the child transaction shapes need to match the search result format), an alternative is to add a guard in the empty state check that prevents showing EmptySearchView while a split operation is in-flight (e.g., by checking for a pending split action or setting isLoading on the snapshot during the split).

    What alternative solutions did you explore? (Optional)

    1. Show loading skeleton instead of empty state - Could set search.isLoading = true on the snapshot in the split optimistic data, which would trigger shouldShowLoadingState and show a skeleton instead of the empty state. This is simpler but shows a skeleton flash instead of solving the root issue.

    2. Use lastNonEmptySearchResults fallback - The SearchPage already has a lastNonEmptySearchResults ref, but it only activates during sorting. Extending it to cover mutation-induced empty states would prevent the flash but adds complexity to the rendering logic.

    Investigation details

    Data flow:

    1. User selects expense in Search and triggers split
    2. updateSplitTransactions() builds optimistic Onyx data that nulls the original transaction in ONYXKEYS.COLLECTION.SNAPSHOT_{hash}
    3. New child transactions are created in ONYXKEYS.COLLECTION.TRANSACTION but never injected into the snapshot
    4. Search component re-renders: isDataLoaded is true, visibleDataLength is 0
    5. All empty state guards evaluate to false (none cover this scenario)
    6. EmptySearchView renders
    7. Search useEffect fires handleSearch() which calls the server
    8. Server returns split children in new snapshot, list re-renders correctly

    Why isAnyVisibleActionLoading doesn't help: This guard checks filteredData items for loading report metadata, but since the original transaction was nulled out, filteredData is empty, so the check returns false.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. luacmartins commented on Apr 27, 2026

    @luacmartins
    Contributor

    I think we can add those to the snapshot optimistically. Maybe the order we do that could help here, i.e. first just add the transaction key (with empty object) to the current snapshot, then we merge the actual split data, which Onyx should replicate automatically. @MelvinBot is the optimisticData applied in order when we call the API? If so, can you implement your solution and adjust it with my comment?

  8. 2 remaining items

  9. MelvinBot commented on Apr 27, 2026

    @MelvinBot
    Contributor

    Draft PR created: #88982
    Please mark it as "Ready for review" when it is ready for review.

  10. m-natarajan commented on Apr 28, 2026

    @m-natarajan

    Not Repro, Galaxy A55/ Android 16 and Web/Chrome, v9.3.64-0

    repro.-.issue.88954.mp4
    REC-20260428164444.mp4
  11. luacmartins commented on Apr 28, 2026

    @luacmartins
    Contributor

    Fixed. Closing

  12. changed the title [-]Spend - Empty state screen displayed for some seconds after splitting an expense.[/-] [+][Due for payment 2026-05-07] Spend - Empty state screen displayed for some seconds after splitting an expense.[/+] on Apr 30, 2026
  13. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on Apr 30, 2026

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2026-05-07. 🎊

    For reference, here are some details about the assignees on this issue:

  15. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    @ZhenjaHorbach The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]

  16. melvin-bot commented on Jul 23, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions