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
Expense - Report RHP re-renders every time clicking Create expense #85155
Version Number: 9.3.37-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#82764 Email or phone of affected tester (no customers):biruknew45+yh6g@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Web App Component: Money Requests
Action Performed:
Precondition -
Have a report with a couple of expenses(at least two)
👋 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: #82764 - "Freeze non top screens to prevent extra-rerenders" by @VickyStash (High confidence) Related Issues: #33725, #9402
Recommendation: REVERT
PR #82764 introduced screen freezing to prevent unnecessary re-renders of non-visible screens. However, this is causing the report RHP to re-render when clicking "Create expense" because the navigation triggers the freeze/unfreeze mechanism on the underlying screen.
Labels: Keeping DeployBlockerCash (this blocks the App deploy). DeployBlocker was not present on this issue, so no label changes are needed.
📋 Detailed Analysis
Evidence
The issue is reproducible only in staging (v9.3.37-0), not in production
src/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/ScreenFreezeWrapper.tsx - New wrapper component for freezing
These files directly control navigation and screen rendering behavior in the split navigator (used on web).
Root Cause
When the user clicks "Create expense" from the expense preview, the app navigates to a new screen. This causes the underlying report RHP to become "not on top" in the navigation stack. The screen freezing mechanism then:
Detects the report RHP is no longer the top screen (isOnTop = false)
Triggers the ScreenFreezeWrapper to freeze the screen
The freeze/unfreeze transition causes the visible re-render that users are experiencing
The issue occurs specifically on web because:
The split navigator (with freezeNonTopScreens: true) is used on web layouts
The RHP remains visible in the background while the new screen opens
The freeze state change triggers a render that is visually apparent to users
Please re-state the problem that we are trying to solve in this issue.
When viewing a workspace chat report with expenses and clicking "+" > "Create Expense" from the expenses preview, the report RHP (central pane of the split navigator) visually re-renders/flickers. This was introduced by PR #82764 ("Freeze non top screens to prevent extra-rerenders") and is reproducible on staging but not production.
What is the root cause of that problem?
The root cause is that the wrappedDescriptors computation in src/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/index.tsx:108-122 is not memoized. Every time the PlatformNavigator component re-renders, it creates a brand-new wrappedDescriptors object with new render() function closures — even when nothing meaningful has changed.
Here's the chain of events:
Clicking "Create expense" pushes the RightModalNavigator onto the root stack, changing the root navigation state.
React Navigation's context propagation causes the ReportsSplitNavigator to re-render (even though the split navigator's own internal state hasn't changed).
On re-render, the wrappedDescriptors block (lines 108-122) runs unconditionally, creating new descriptor objects with new render() closures wrapping each screen in ScreenFreezeWrapper.
Since wrappedDescriptors is a new object reference every render, it invalidates the ContentuseMemo on line 124 (which depends on wrappedDescriptors).
StackView receives new descriptors prop and re-renders all screens, including the report screen that the user sees — causing the visible flicker.
Before PR #82764, wrappedDescriptors was simply descriptors (the original from useNavigationBuilder), which was a stable reference across renders. The ContentuseMemo worked correctly. After PR #82764, the wrapping code always creates fresh objects, breaking the memoization.
What changes do you think we should make in order to solve the problem?
Memoize the wrappedDescriptors computation in src/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/index.tsx using useMemo, so it only produces a new object when the underlying inputs actually change (descriptors, state.index, state.routes, and persistentScreens).
This ensures that when the split navigator re-renders due to unrelated navigation state changes (like opening the RHP), the wrapped descriptors remain referentially stable and the ContentuseMemo isn't needlessly invalidated.
What alternative solutions did you explore? (Optional)
Reverting freezeNonTopScreens for the split navigator — This would fix the bug but lose the performance benefit of freezing off-screen central pane screens that PR Freeze non top screens to prevent extra-rerenders #82764 was designed to provide.
Wrapping the entire PlatformNavigator in React.memo — This wouldn't help because the re-render is triggered by internal hooks (useNavigationBuilder), not parent props.
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.
Thanks for the nudge, situchan. I understand the BrowserStack field just links the regression test PR, not necessarily the causing PR. I re-investigated all 50+ PRs in the v9.3.37-0 staging deploy and compared the production ↔ staging diffs for every file in the report rendering + navigation chain.
What I checked
I looked at every PR that touches IOU actions, report rendering, navigation, or Onyx-derived values — specifically:
PR feat: Expand GBR/RBR with an "action badge" #85025 (GBR/RBR action badge): Adds an actionBadge field to reportAttributes derived values and a new policy-load recompute trigger. However, startMoneyRequest only writes to TRANSACTION_DRAFT and SKIP_CONFIRMATION, neither of which is in reportAttributes' dependency list. This PR alone wouldn't trigger a re-render during expense creation.
PR feat: Allow admins to pay with any business bank account they have access to #83638 (bank accounts): Adds useOnyx(BANK_ACCOUNT_LIST) to ReportActionItemMessage, but BANK_ACCOUNT_LIST doesn't change during expense creation. The bankAccountList prop and its deepEqual memo check in PureReportActionItem already existed before this PR.
PR [Merge] Merge tax rates v2 #83587 (merge tax rates): Changes MoneyRequestView.tsx but this component renders individual expense details, not the report header or transaction list that flicker.
TRANSACTION_DRAFT subscriptions (MoneyReportHeader line 288, MoneyRequestReportTransactionList line 199, MoneyRequestReportPreviewContent line 206): These already existed in production with the same non-memoized selectors. They trigger re-renders when clearMoneyRequest nulls draft transactions — but they did so in production too, without a visible flicker.
The only file changed between production and staging that could amplify an existing (invisible) re-render into a visible one is createPlatformStackNavigatorComponent/index.tsx (PR #82764). Here's the mechanism:
Production: When the SplitNavigator re-renders (from navigation context or TRANSACTION_DRAFT changes), wrappedDescriptors is simply the stable descriptors reference from useNavigationBuilder. The ContentuseMemo (line 124) correctly prevents StackView from re-rendering.
Staging: PR Freeze non top screens to prevent extra-rerenders #82764 added freezeNonTopScreens: true, which wraps descriptors at lines 108-122. This wrapping is not memoized — it creates new objects with new render() closures on every render. Since wrappedDescriptors is always a new reference, the ContentuseMemo is invalidated, and StackView re-renders all screens including the visible report — causing the flicker.
The TRANSACTION_DRAFT writes from clearMoneyRequest acted as the trigger (causing the SplitNavigator to re-render), and the un-memoized wrappedDescriptors from PR #82764 is the amplifier (turning an invisible React re-render into a visible DOM update).
If you have evidence the bug reproduces even after reverting PR #82764, I'm happy to investigate further. But based on the production ↔ staging comparison, PR #82764's un-memoized wrappedDescriptors is the only change that could convert existing re-renders into visible flicker.
false alarm ^ @MelvinBot, for further investigations, make sure to check if component is compatible with React Compiler before finding un-memoization as root cause.
Activity
melvin-bot commentedon Mar 13, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #82764
melvin-bot commentedon Mar 13, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 13, 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 Mar 13, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #82764 - "Freeze non top screens to prevent extra-rerenders" by @VickyStash (High confidence)
Related Issues: #33725, #9402
Recommendation: REVERT
PR #82764 introduced screen freezing to prevent unnecessary re-renders of non-visible screens. However, this is causing the report RHP to re-render when clicking "Create expense" because the navigation triggers the freeze/unfreeze mechanism on the underlying screen.
Labels: Keeping
DeployBlockerCash(this blocks the App deploy).DeployBlockerwas not present on this issue, so no label changes are needed.📋 Detailed Analysis
Evidence
Verification
The causing PR modified:
src/libs/Navigation/AppNavigator/createSplitNavigator/index.tsx- AddedfreezeNonTopScreens: truesrc/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/index.tsx- Implemented screen freezing logicsrc/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/ScreenFreezeWrapper.tsx- New wrapper component for freezingThese files directly control navigation and screen rendering behavior in the split navigator (used on web).
Root Cause
When the user clicks "Create expense" from the expense preview, the app navigates to a new screen. This causes the underlying report RHP to become "not on top" in the navigation stack. The screen freezing mechanism then:
isOnTop = false)ScreenFreezeWrapperto freeze the screenThe issue occurs specifically on web because:
freezeNonTopScreens: true) is used on web layoutsMelvinBot commentedon Mar 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When viewing a workspace chat report with expenses and clicking "+" > "Create Expense" from the expenses preview, the report RHP (central pane of the split navigator) visually re-renders/flickers. This was introduced by PR #82764 ("Freeze non top screens to prevent extra-rerenders") and is reproducible on staging but not production.
What is the root cause of that problem?
The root cause is that the
wrappedDescriptorscomputation insrc/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/index.tsx:108-122is not memoized. Every time thePlatformNavigatorcomponent re-renders, it creates a brand-newwrappedDescriptorsobject with newrender()function closures — even when nothing meaningful has changed.Here's the chain of events:
RightModalNavigatoronto the root stack, changing the root navigation state.ReportsSplitNavigatorto re-render (even though the split navigator's own internal state hasn't changed).wrappedDescriptorsblock (lines 108-122) runs unconditionally, creating new descriptor objects with newrender()closures wrapping each screen inScreenFreezeWrapper.wrappedDescriptorsis a new object reference every render, it invalidates theContentuseMemoon line 124 (which depends onwrappedDescriptors).StackViewreceives newdescriptorsprop and re-renders all screens, including the report screen that the user sees — causing the visible flicker.Before PR #82764,
wrappedDescriptorswas simplydescriptors(the original fromuseNavigationBuilder), which was a stable reference across renders. TheContentuseMemoworked correctly. After PR #82764, the wrapping code always creates fresh objects, breaking the memoization.What changes do you think we should make in order to solve the problem?
Memoize the
wrappedDescriptorscomputation insrc/libs/Navigation/PlatformStackNavigation/createPlatformStackNavigatorComponent/index.tsxusinguseMemo, so it only produces a new object when the underlying inputs actually change (descriptors,state.index,state.routes, andpersistentScreens).This ensures that when the split navigator re-renders due to unrelated navigation state changes (like opening the RHP), the wrapped descriptors remain referentially stable and the
ContentuseMemoisn't needlessly invalidated.What alternative solutions did you explore? (Optional)
freezeNonTopScreensfor the split navigator — This would fix the bug but lose the performance benefit of freezing off-screen central pane screens that PR Freeze non top screens to prevent extra-rerenders #82764 was designed to provide.PlatformNavigatorinReact.memo— This wouldn't help because the re-render is triggered by internal hooks (useNavigationBuilder), not parent props.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.situchan commentedon Mar 13, 2026
@MelvinBot this doesn't mean that PR caused this regression. Can you re-investigate? There should be another PR which introduced this bug.
situchan commentedon Mar 13, 2026
I managed to find offending PR
MelvinBot commentedon Mar 13, 2026
Thanks for the nudge,
situchan. I understand the BrowserStack field just links the regression test PR, not necessarily the causing PR. I re-investigated all 50+ PRs in the v9.3.37-0 staging deploy and compared the production ↔ staging diffs for every file in the report rendering + navigation chain.What I checked
I looked at every PR that touches IOU actions, report rendering, navigation, or Onyx-derived values — specifically:
startMoneyRequest,clearMoneyRequest,getAddExpenseDropdownOptionsare all functionally unchanged for the "Create expense" button click. No new Onyx writes were added to this flow.actionBadgefield toreportAttributesderived values and a new policy-load recompute trigger. However,startMoneyRequestonly writes toTRANSACTION_DRAFTandSKIP_CONFIRMATION, neither of which is inreportAttributes' dependency list. This PR alone wouldn't trigger a re-render during expense creation.useOnyx(BANK_ACCOUNT_LIST)toReportActionItemMessage, butBANK_ACCOUNT_LISTdoesn't change during expense creation. ThebankAccountListprop and itsdeepEqualmemo check inPureReportActionItemalready existed before this PR.MoneyRequestView.tsxbut this component renders individual expense details, not the report header or transaction list that flicker.clearMoneyRequestnulls draft transactions — but they did so in production too, without a visible flicker.Why the evidence still points to PR #82764
The only file changed between production and staging that could amplify an existing (invisible) re-render into a visible one is
createPlatformStackNavigatorComponent/index.tsx(PR #82764). Here's the mechanism:Production: When the SplitNavigator re-renders (from navigation context or TRANSACTION_DRAFT changes),
wrappedDescriptorsis simply the stabledescriptorsreference fromuseNavigationBuilder. TheContentuseMemo(line 124) correctly prevents StackView from re-rendering.Staging: PR Freeze non top screens to prevent extra-rerenders #82764 added
freezeNonTopScreens: true, which wraps descriptors at lines 108-122. This wrapping is not memoized — it creates new objects with newrender()closures on every render. SincewrappedDescriptorsis always a new reference, theContentuseMemois invalidated, and StackView re-renders all screens including the visible report — causing the flicker.The TRANSACTION_DRAFT writes from
clearMoneyRequestacted as the trigger (causing the SplitNavigator to re-render), and the un-memoizedwrappedDescriptorsfrom PR #82764 is the amplifier (turning an invisible React re-render into a visible DOM update).If you have evidence the bug reproduces even after reverting PR #82764, I'm happy to investigate further. But based on the production ↔ staging comparison, PR #82764's un-memoized
wrappedDescriptorsis the only change that could convert existing re-renders into visible flicker.situchan commentedon Mar 13, 2026
false alarm ^
@MelvinBot, for further investigations, make sure to check if component is compatible with React Compiler before finding un-memoization as root cause.
situchan commentedon Mar 13, 2026
#85171 should fix this
GCyganek commentedon Mar 13, 2026
Checking if there is a way to fix this without the revert...
GCyganek commentedon Mar 13, 2026
My fix so that we do not have to revert
IuliiaHerets commentedon Mar 13, 2026
Chrome / v9.3.37-7
Not reproduce
Screen.Recording.2026-03-13.at.21.29.03.mp4
luacmartins commentedon Mar 13, 2026
Fixed. Closing.