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
[Due for payment 2026-05-07] Spend - Empty state screen displayed for some seconds after splitting an expense. #88954
👋 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.
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)
The bug is reproducible on staging but not production, which aligns with PR Introduce a Bottom Tab Navigator for Top-Level Navigation #85234 being merged on 2026-04-24 and included in the 9.3.62-5 staging build (entry 124 in the StagingDeployCash chronological list).
The bug affects the Search tab ("All Expenses") after performing a split expense action that opens a modal, which is exactly the interaction path most affected by the new tab navigator's freeze-on-blur behavior.
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.
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)
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.
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:
User selects expense in Search and triggers split
updateSplitTransactions() builds optimistic Onyx data that nulls the original transaction in ONYXKEYS.COLLECTION.SNAPSHOT_{hash}
New child transactions are created in ONYXKEYS.COLLECTION.TRANSACTION but never injected into the snapshot
Search component re-renders: isDataLoaded is true, visibleDataLength is 0
All empty state guards evaluate to false (none cover this scenario)
EmptySearchView renders
Search useEffect fires handleSearch() which calls the server
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.
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?
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
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:
@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]
Activity
melvin-bot commentedon Apr 27, 2026
Triggered auto assignment to @arosiclair (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Apr 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 27, 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:
OSBotify commentedon Apr 27, 2026
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
createBottomTabNavigatorreplacing individual root-stack screens). ThefreezeOnBlur: trueandlazy: trueoptions on the newTabNavigatorcause 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:
DeployBlockerCashkept (frontend bug, no label changes needed —DeployBlockerwas not present)Detailed Analysis
Evidence
9.3.62-5staging build (entry 124 in the StagingDeployCash chronological list).Verification
src/libs/Navigation/AppNavigator/Navigators/SearchFullscreenNavigator.tsx,src/libs/Navigation/AppNavigator/Navigators/TabNavigator.native.tsx,src/libs/Navigation/AppNavigator/FreezeWrapper/index.native.tsxSearchFullscreenNavigator.tsx(changes its parent type fromAuthScreensParamListtoTabNavigatorParamListand wraps it inFreezeWrapper), introducesTabNavigator.native.tsxwithfreezeOnBlur: trueandlazy: true, and changesFreezeWrapper/index.native.tsxto a no-op (deferring toreact-native-screensnative freeze).Root Cause
Before PR #85234, the
SearchFullscreenNavigatorwas an independent screen pushed directly onto the root stack. After this PR, it lives as a tab inside acreateBottomTabNavigatorwithfreezeOnBlur: 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-screensbriefly 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.MelvinBot commentedon Apr 27, 2026
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
nullin the search snapshot, but the new split child transactions are not added to the snapshot optimistically. This causesvisibleDataLengthto 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
shouldShowEmptyStateseesdataLength === 0, theEmptySearchViewrenders 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
EmptySearchViewwhile a split operation is in-flight (e.g., by checking for a pending split action or settingisLoadingon the snapshot during the split).What alternative solutions did you explore? (Optional)
Show loading skeleton instead of empty state - Could set
search.isLoading = trueon the snapshot in the split optimistic data, which would triggershouldShowLoadingStateand show a skeleton instead of the empty state. This is simpler but shows a skeleton flash instead of solving the root issue.Use
lastNonEmptySearchResultsfallback - The SearchPage already has alastNonEmptySearchResultsref, 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:
updateSplitTransactions()builds optimistic Onyx data that nulls the original transaction inONYXKEYS.COLLECTION.SNAPSHOT_{hash}ONYXKEYS.COLLECTION.TRANSACTIONbut never injected into the snapshotisDataLoadedis true,visibleDataLengthis 0EmptySearchViewrendersuseEffectfireshandleSearch()which calls the serverWhy
isAnyVisibleActionLoadingdoesn't help: This guard checksfilteredDataitems for loading report metadata, but since the original transaction was nulled out,filteredDatais empty, so the check returns false.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.luacmartins commentedon Apr 27, 2026
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?
2 remaining items
MelvinBot commentedon Apr 27, 2026
Draft PR created: #88982
Please mark it as "Ready for review" when it is ready for review.
m-natarajan commentedon Apr 28, 2026
Not Repro, Galaxy A55/ Android 16 and Web/Chrome, v9.3.64-0
repro.-.issue.88954.mp4
REC-20260428164444.mp4
luacmartins commentedon Apr 28, 2026
Fixed. Closing
[-]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.[/+]melvin-bot commentedon Apr 30, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 30, 2026
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:
melvin-bot commentedon Apr 30, 2026
@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]
melvin-bot commentedon Jul 23, 2026
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.