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-11-19] [$175] IOU - Report page is blank when add second expense on scrolled chat #100303
When the second expense is added to a chat, the app scrolls the list to an index far outside the rendered window, and the inverted FlashList ends up parked at an offset where nothing is materialized — a blank viewport.
constindex=sortedVisibleReportActions.findIndex((item)=>item.reportActionID===action?.reportActionID);if(action?.actionName===CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW){if(index>0){setTimeout(()=>{reportScrollManager.scrollToIndex(index);},100);}else{setIsFloatingMessageCounterVisible(false);reportScrollManager.scrollToBottom();}
...
}setIsScrollToBottomEnabled(true);// armed even on the scrollToIndex path
Two things make expense #2 different from expense #1:
The report-preview action is reused, not re-created. For the second expense the open expense report still accepts transactions, so MoneyRequestBuilder.ts:1635 reuses the existing preview and merges it in place via updateReportPreview, which changes neither reportActionID nor created. The preview therefore stays buried under all the messages sent in step 2, so index is large instead of 0.
The list is scrolled up, which is also what enables maintainVisibleContentPosition (useReportActionsScroll.ts:209-219 — it's gated on hasScrolledOverThreshold).
FlashList v2 takes no estimatedItemSize; a jump to a distant, never-measured index is computed from running-average heights and clamped only against the estimated content height. Chat rows vary wildly in height, so the resulting offset can land past the real content end. On iOS a programmatic setContentOffset: is not clamped to content bounds. The team has already hit this exact failure mode — see the comment at MoneyRequestReportActionsList.tsx:588-591 ("scrollToEnd targets an estimated content-end offset that leaves the bottom blank on large transaction+chat lists").
Making it worse, setIsScrollToBottomEnabled(true) on line 147 is outside the if/else, so the scrollToIndex path also arms a scrollToBottom() that fires on the list's next layout (ReportActionsList.tsx:481-484 → flushPendingScrollToBottom) — two overlapping scroll state machines while MVCP offset correction is suspended.
Note the expected result in the report, "Page should scroll to the Reports", is exactly what the index > 0 branch intends. The intent is right; the execution strands the scroll offset.
What changes do you think we should make in order to solve the problem?
Move setIsScrollToBottomEnabled(true) (line 147) into the branches that actually want a bottom scroll, so the scrollToIndex path stops arming a competing flushPendingScrollToBottom().
Make the jump safe. Either pass viewPosition so FlashList anchors the target row in the viewport instead of landing on a bare offset, or gate the scrollToIndex on the target being within/near the rendered window and fall back to scrollToBottom() otherwise. A follow-up offset check after measurement settles (re-clamping against the real contentSize.height) would make it robust for very long histories.
What alternative solutions did you explore? (Optional)
Ruled out and residual uncertainty
Ruled out:
Empty data array. If sortedVisibleReportActions went empty, shouldShowDerivedTimingSkeleton would render a skeleton, not a blank page.
Screen remount / re-keyed list. The RHP dismissal degrades to a plain dismissModal() because the report is already topmost (Navigation.ts:952-957), so listID is stable and the FlashList is not re-keyed.
openReport refiring / page pruning. The live-tail jump that would prune pages is explicitly skipped for REPORT_PREVIEW actions (line 111-112).
Item count / key churn.keyExtractor is reportActionID, and the reused preview keeps its ID and created, so nothing reorders.
Not verified — needs an on-device iOS repro. This is a client-side scroll race with no server-side trace, so there is no log evidence to confirm it. I could not distinguish which native step actually strands the offset (unclamped setContentOffset:, a content-height collapse after real measurement, or an MVCP scrollBy with a stale anchor); all three land in the same place. Instrumenting the index passed to scrollToIndex, plus contentOffset.y versus the real contentSize.height right after the jump, would settle it.
Platform scope. Only iOS is checked on the report. Android runs the same useReportScrollManager/index.native.ts code path and may differ only because its inverted path takes a clamped scrollTo fallback — worth re-testing on Android before assuming it is iOS-only. On web, DOM scrollTop clamps, which fits the non-repro there.
Regressing PR. Not pinned. git blame on the branch points at #94474, but that PR is an InteractionManager migration that only rewrapped the surrounding lines, and the file moved from src/pages/home/report/ to src/pages/inbox/report/, so blame is obscured.
Possibly related (not duplicates):#99559 (chat not autoscrolled to bottom after sending messages, web) and #92420 (blank WS chat after tapping the floating pill) touch the same scroll-after-new-action machinery.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/100303) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
In a chat with existing message history that is scrolled up, adding a second expense to an existing report results in the chat/report view rendering as a blank screen when returning to it.
What is the root cause of that problem?
In src/pages/inbox/report/useReportActionsNewActionLiveTail.ts (lines 129-148):
Unconditional setIsScrollToBottomEnabled(true): setIsScrollToBottomEnabled(true) is placed unconditionally at line 147 outside the if/else block. Even when index > 0 executes scrollToIndex(index), setIsScrollToBottomEnabled(true) arms a flushPendingScrollToBottom() trigger in ReportActionsList. On the next layout pass, scrollToBottom() fires immediately after scrollToIndex(index), causing two competing scroll commands to fight each other.
Unclamped/Unmeasured scrollToIndex in FlashList:
When a second expense is added to an existing report, the backend reuses the existing REPORT_PREVIEW action (MoneyRequestBuilder.ts and updateReportPreview). The preview action retains its original reportActionID and timestamp. In a chat with messages sent afterwards, index is deep in the list (e.g. index 25+). When scrollToIndex(index) runs on an inverted FlashList before that distant item has been laid out and measured in the current window, FlashList computes an offset from unmeasured estimates that can overshoot the actual content bounds. With offset maintenance suspended, FlashList parks the scroll container at an offset where no items are materialized, rendering a blank white page.
What changes do you think we should make in order to solve the problem?
In src/pages/inbox/report/useReportActionsNewActionLiveTail.ts:
Move setIsScrollToBottomEnabled(true) inside the bottom-scroll branches:
Only enable isScrollToBottomEnabled(true) when genuinely scrolling to the bottom (line 137 and line 144). Do not arm flushPendingScrollToBottom() when scrollToIndex is triggered.
Anchor the scroll with viewPosition and validate bounds:
Pass {viewPosition: 0.5} to reportScrollManager.scrollToIndex so FlashList anchors the target row smoothly in the visible viewport. If index is not found (index === -1), fall back to scrollToBottom().
Automated Testing:
Add unit test in tests/unit/useReportActionsNewActionLiveTailTest.ts:
Verify that when a REPORT_PREVIEW action has index > 0, scrollToIndex is called with the action index and isScrollToBottomEnabled remains false.
Verify that when a REPORT_PREVIEW action has index <= 0 or any other action type arrives, scrollToBottom is called and isScrollToBottomEnabled is set to true.
What alternative solutions did you explore? (Optional)
Always calling scrollToBottom() on expense creation:
Rejected because when a user adds an expense to an existing report that is located higher in the chat, scrolling them all the way to the bottom away from the expense preview they just modified is confusing and contradicts the intended UX. Anchoring to the preview with viewPosition: 0.5 while disabling the conflicting bottom flush preserves the intended behavior without stranding the scroll offset.
changed the title [-][$175] IOU - Report page is blank when add second expense on scrolled chat[/-][+][Due for payment 2026-11-19] [$175] IOU - Report page is blank when add second expense on scrolled chat[/+]on Nov 12, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.36-0 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-11-19. 🎊
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]
That PR changed native maintainVisibleContentPosition (MVCP) to turn off when disabled is set, while keeping the scroll anchor mounted (offending condition). Re-enabling MVCP can then expose React Native’s stale-anchor bug.
The evidence:
It merged April 30, before the affected release, and that condition remained unchanged in version 9.4.69-0.
Removing that exact condition fixed their reproduction; restoring it brought the blank page back.
Remaining uncertainty:Upgrade React Native to 0.85.3, merged July 9, introduced recycled-view frame zeroing, which could have been the later trigger. The existing reproduction does not distinguish a missing anchor from a recycled, zero-frame anchor.
So the MVCP change is causally implicated, but identifying the first bad PR conclusively still requires historical iOS before/after testing. I have not independently reproduced that native behavior in this web-only run.
Activity
applause-bot commentedon Sep 3, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/cff304826d339a719cb4f3dd301b4b497ab005f850b33764fd58c3134d93ef96
MelvinBot commentedon Sep 3, 2026
Proposal
What is the root cause of that problem?
When the second expense is added to a chat, the app scrolls the list to an index far outside the rendered window, and the inverted FlashList ends up parked at an offset where nothing is materialized — a blank viewport.
The fork is in
useReportActionsNewActionLiveTail.ts:129-147:Two things make expense #2 different from expense #1:
MoneyRequestBuilder.ts:1635reuses the existing preview and merges it in place viaupdateReportPreview, which changes neitherreportActionIDnorcreated. The preview therefore stays buried under all the messages sent in step 2, soindexis large instead of0.maintainVisibleContentPosition(useReportActionsScroll.ts:209-219— it's gated onhasScrolledOverThreshold).FlashList v2 takes no
estimatedItemSize; a jump to a distant, never-measured index is computed from running-average heights and clamped only against the estimated content height. Chat rows vary wildly in height, so the resulting offset can land past the real content end. On iOS a programmaticsetContentOffset:is not clamped to content bounds. The team has already hit this exact failure mode — see the comment atMoneyRequestReportActionsList.tsx:588-591("scrollToEnd targets an estimated content-end offset that leaves the bottom blank on large transaction+chat lists").Making it worse,
setIsScrollToBottomEnabled(true)on line 147 is outside theif/else, so thescrollToIndexpath also arms ascrollToBottom()that fires on the list's next layout (ReportActionsList.tsx:481-484→flushPendingScrollToBottom) — two overlapping scroll state machines while MVCP offset correction is suspended.Note the expected result in the report, "Page should scroll to the Reports", is exactly what the
index > 0branch intends. The intent is right; the execution strands the scroll offset.What changes do you think we should make in order to solve the problem?
In
useReportActionsNewActionLiveTail.ts:setIsScrollToBottomEnabled(true)(line 147) into the branches that actually want a bottom scroll, so thescrollToIndexpath stops arming a competingflushPendingScrollToBottom().viewPositionso FlashList anchors the target row in the viewport instead of landing on a bare offset, or gate thescrollToIndexon the target being within/near the rendered window and fall back toscrollToBottom()otherwise. A follow-up offset check after measurement settles (re-clamping against the realcontentSize.height) would make it robust for very long histories.What alternative solutions did you explore? (Optional)
Ruled out and residual uncertainty
Ruled out:
sortedVisibleReportActionswent empty,shouldShowDerivedTimingSkeletonwould render a skeleton, not a blank page.dismissModal()because the report is already topmost (Navigation.ts:952-957), solistIDis stable and the FlashList is not re-keyed.openReportrefiring / page pruning. The live-tail jump that would prune pages is explicitly skipped forREPORT_PREVIEWactions (line 111-112).keyExtractorisreportActionID, and the reused preview keeps its ID andcreated, so nothing reorders.Not verified — needs an on-device iOS repro. This is a client-side scroll race with no server-side trace, so there is no log evidence to confirm it. I could not distinguish which native step actually strands the offset (unclamped
setContentOffset:, a content-height collapse after real measurement, or an MVCPscrollBywith a stale anchor); all three land in the same place. Instrumenting theindexpassed toscrollToIndex, pluscontentOffset.yversus the realcontentSize.heightright after the jump, would settle it.Platform scope. Only iOS is checked on the report. Android runs the same
useReportScrollManager/index.native.tscode path and may differ only because its inverted path takes a clampedscrollTofallback — worth re-testing on Android before assuming it is iOS-only. On web, DOMscrollTopclamps, which fits the non-repro there.Regressing PR. Not pinned.
git blameon the branch points at #94474, but that PR is anInteractionManagermigration that only rewrapped the surrounding lines, and the file moved fromsrc/pages/home/report/tosrc/pages/inbox/report/, so blame is obscured.Possibly related (not duplicates): #99559 (chat not autoscrolled to bottom after sending messages, web) and #92420 (blank WS chat after tapping the floating pill) touch the same scroll-after-new-action machinery.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/100303)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run · view recording
melvin-bot commentedon Sep 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)melvin-bot commentedon Sep 3, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
mukhrr commentedon Sep 4, 2026
cannot reproduce
annaweber830 commentedon Sep 4, 2026
I can reproduce
mananjadhav commentedon Sep 6, 2026
Reviewing.
danielamodu commentedon Sep 7, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In a chat with existing message history that is scrolled up, adding a second expense to an existing report results in the chat/report view rendering as a blank screen when returning to it.
What is the root cause of that problem?
In
src/pages/inbox/report/useReportActionsNewActionLiveTail.ts(lines 129-148):There are two combined root causes:
setIsScrollToBottomEnabled(true):setIsScrollToBottomEnabled(true)is placed unconditionally at line 147 outside theif/elseblock. Even whenindex > 0executesscrollToIndex(index),setIsScrollToBottomEnabled(true)arms aflushPendingScrollToBottom()trigger inReportActionsList. On the next layout pass,scrollToBottom()fires immediately afterscrollToIndex(index), causing two competing scroll commands to fight each other.scrollToIndexin FlashList:When a second expense is added to an existing report, the backend reuses the existing
REPORT_PREVIEWaction (MoneyRequestBuilder.tsandupdateReportPreview). The preview action retains its originalreportActionIDand timestamp. In a chat with messages sent afterwards,indexis deep in the list (e.g. index 25+). WhenscrollToIndex(index)runs on an inverted FlashList before that distant item has been laid out and measured in the current window, FlashList computes an offset from unmeasured estimates that can overshoot the actual content bounds. With offset maintenance suspended, FlashList parks the scroll container at an offset where no items are materialized, rendering a blank white page.What changes do you think we should make in order to solve the problem?
In
src/pages/inbox/report/useReportActionsNewActionLiveTail.ts:Move
setIsScrollToBottomEnabled(true)inside the bottom-scroll branches:Only enable
isScrollToBottomEnabled(true)when genuinely scrolling to the bottom (line 137 and line 144). Do not armflushPendingScrollToBottom()whenscrollToIndexis triggered.Anchor the scroll with
viewPositionand validate bounds:Pass
{viewPosition: 0.5}toreportScrollManager.scrollToIndexso FlashList anchors the target row smoothly in the visible viewport. Ifindexis not found (index === -1), fall back toscrollToBottom().Add unit test in
tests/unit/useReportActionsNewActionLiveTailTest.ts:REPORT_PREVIEWaction hasindex > 0,scrollToIndexis called with the action index andisScrollToBottomEnabledremainsfalse.REPORT_PREVIEWaction hasindex <= 0or any other action type arrives,scrollToBottomis called andisScrollToBottomEnabledis set totrue.What alternative solutions did you explore? (Optional)
scrollToBottom()on expense creation:Rejected because when a user adds an expense to an existing report that is located higher in the chat, scrolling them all the way to the bottom away from the expense preview they just modified is confusing and contradicts the intended UX. Anchoring to the preview with
viewPosition: 0.5while disabling the conflicting bottom flush preserves the intended behavior without stranding the scroll offset.melvin-bot commentedon Sep 9, 2026
@mananjadhav Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
24 remaining items
melvin-bot commentedon Oct 28, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022115541730958638789
melvin-bot commentedon Oct 28, 2026
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
jeffrey-graham commentedon Nov 7, 2026
melvin-bot commentedon Nov 7, 2026
[-][$175] IOU - Report page is blank when add second expense on scrolled chat[/-][+][Due for payment 2026-11-19] [$175] IOU - Report page is blank when add second expense on scrolled chat[/+]melvin-bot commentedon Nov 12, 2026
@mananjadhav
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.36-0 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-11-19. 🎊
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]
mananjadhav commentedon Nov 12, 2026
PR was just deployed. Waiting through regression period.
mananjadhav commentedon Nov 15, 2026
@MelvinBot Can we identify the offending PR for this one?
MelvinBot commentedon Nov 15, 2026
The strongest candidate is fix(iOS): prevent native MVCP from activating when disabled flag is set in FlashList patch 007, but I would mark it “likely,” not confirmed.
That PR changed native
maintainVisibleContentPosition(MVCP) to turn off whendisabledis set, while keeping the scroll anchor mounted (offending condition). Re-enabling MVCP can then expose React Native’s stale-anchor bug.The evidence:
Remaining uncertainty: Upgrade React Native to 0.85.3, merged July 9, introduced recycled-view frame zeroing, which could have been the later trigger. The existing reproduction does not distinguish a missing anchor from a recycled, zero-frame anchor.
So the MVCP change is causally implicated, but identifying the first bad PR conclusively still requires historical iOS before/after testing. I have not independently reproduced that native behavior in this web-only run.
view run