[Due for payment 2026-11-16] [$175] Chat - "Latest messages" pill remains visible after sending a message
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.5.32-0 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://github.com/Expensify/App/pull/104242 Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5.1 Safrai, iPhone 13 iOS 26.6 App Component: Chat Report View
Action Performed:
- Go to https://staging.new.expensify.com
- Open a chat from a deep link to an old message
- Send a message. Verify the list jumps to the newest messages and your message is visible.
Expected Result:
The "Latest messages" pill should disappear after sending a message and the chat jumps to the newest messages.
Actual Result:
"Latest messages" pill remains visible after sending a message and jumping to the newest messages
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/68841592-06ec-4e66-9c6b-4fff83cf61f2
Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7305231
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022118101852933175590
- Upwork Job ID: 2118101852933175590
- Last Price Increase: 2026-11-04
Issue Owner
Current Issue Owner: @mallenexpensify
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/856c26d65da95854a9a909090893790e861bbb6206a51b00fe02424d2612f4c1
🤖 Web test steps verification results: ⚠️ partial
The handed-over dev NewDot web session was accessible. Missing historical-message fixtures blocked reproduction of issue 106015.
| Step | Status |
|---|---|
1. Open the app in the handed-over sessionAuthenticated Home and Inbox rendered. |
✅ |
2. Open an old-message deep link with newer messages offscreenFixture blocked: available Concierge history contained only its welcome message, without an eligible old-message link and newer-message history.![]() |
❌ |
3. Send and verify newest messages and the sent message become visibleNot executed: blocked by the missing historical-message fixture. |
❌ |
4. Verify Latest messages disappears after the jumpNot executed: the required send-triggered jump could not be tested. The pill's presence alone does not reproduce the issue. |
❌ |
Proposal
What is the root cause of that problem?
Likely stale scroll tracking after the jump; medium confidence, not reproduced. Sending hides the pill, but a subsequent content-size callback can show it again using the historical scroll offset. The deferred jump does not synchronize that offset or pill visibility.
Code evidence and limits
- useReportActionsNewActionLiveTail.ts:191–221 hides the pill before scheduling scrolling.
- useReportActionsListScroll.ts:200–216 recalculates visibility before flushing the jump.
- useReportUnreadMessageScrollTracking.ts:98–137 can reuse the old offset. Normal bottom-scroll events should correct it; missing events or newer-page state remain alternatives.
- useReportActionsScroll.ts:426–432 requests scrolling without reconciling tracking state.
Web verification was blocked by missing historical-message fixtures. The event sequence remains unconfirmed.
What changes do you think we should make in order to solve the problem?
Add a regression test covering deep-link list replacement, stale offset, content-size callbacks, and no subsequent scroll event. Synchronize offset and pill visibility when the newest-page jump completes, guarded by list readiness. Avoid unconditionally assuming a scroll request succeeded.
Verify scrolling upward restores the pill; cover offline sends and unread markers.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106015) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (External)
Job added to Upwork: https://www.upwork.com/jobs/~022118101852933175590
Proposal
Please re-state the problem that we are trying to solve in this issue
When opening a chat via a deep link to an older message (where the "Latest messages" pill is visible) and sending a new message, the chat list jumps to the newest messages at the bottom, but the "Latest messages" pill remains visible on screen instead of disappearing.
What is the root cause of that problem?
When a report is opened at a deep-linked older message (linkedReportActionID), scrollOffsetRef.current (provided by ActionListContext above InvertedFlashList) holds the non-zero scroll offset (> CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLD) from the deep-linked position, and isFloatingMessageCounterVisible is true.
When the current user sends a message from that deep-linked view, useReportActionsNewActionLiveTail.ts runs the live-tail jump sequence:
scrollToBottomForCurrentUserAction(lines 125-136) callsopenReportAtLiveTail()and setsliveTailJumpRef.current = {stage: 'open_report'}.- Once
openReportfinishes loading (src/pages/inbox/report/useReportActionsNewActionLiveTail.ts, lines 191-205), it setssetTreatAsNoPaginationAnchor(true), callsclearLinkedActionParam()(navigation.setParams({reportActionID: ''})), and transitions tostage: 'await_scroll'. - In the next effect (
src/pages/inbox/report/useReportActionsNewActionLiveTail.ts, lines 207-221), oncehasNewestReportActionis true, it callssetIsFloatingMessageCounterVisible(false)and schedulessetIsScrollToBottomEnabled(true)in a microtask:
liveTailJumpRef.current = {stage: 'await_prune'};
setIsFloatingMessageCounterVisible(false);
// Defer so this effect does not synchronously chain a second render from setState (eslint react-hooks/set-state-in-effect).
queueMicrotask(() => {
setIsScrollToBottomEnabled(true);
});
- Clearing
linkedReportActionIDchangeslistIDinsrc/pages/inbox/report/ReportActionsList/useReportActionsListScroll.ts(line 71:const listID = [reportID, linkedReportActionID, ...].join(':')), which is passed askey={listID}to<InvertedFlashList>(ReportActionsListContent.tsx, line 265). This remountsInvertedFlashListat the bottom (index 0, scroll offset 0), whileActionListContext'sscrollOffsetRef.currentremains mounted above it and still retains the stale deep-link offset (> ACTION_VISIBLE_THRESHOLD). - When the remounted list fires
onContentSizeChange(src/pages/inbox/report/ReportActionsList/useReportActionsListScroll.ts, lines 214-217):
onContentSizeChange: () => {
trackVerticalScrolling(undefined);
flushPendingScrollToBottom();
},
trackVerticalScrolling(undefined) calls updatePillVisibility() (src/pages/inbox/report/useReportUnreadMessageScrollTracking.ts, lines 98-120) with event === undefined, so scrollOffsetRef.current is not updated. Because scrollOffsetRef.current still holds the old deep-link offset (> CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLD) and isFloatingMessageCounterVisible was just set to false, updatePillVisibility() immediately sets setIsFloatingMessageCounterVisible(true) again!
6. Right after that, flushPendingScrollToBottom() runs (src/hooks/useReportActionsScroll.ts, lines 426-433):
const flushPendingScrollToBottom = () => {
if (!isScrollToBottomEnabled) {
return;
}
reportScrollManager.scrollToBottom();
setIsScrollToBottomEnabled(false);
completeLiveTailPruneAfterScrollToBottom();
};
Because the remounted InvertedFlashList is already positioned at index 0 (or scrollToIndex({index: 0, animated: false}) is a no-op at offset 0), no native onScroll event is emitted, scrollOffsetRef.current is never reset to 0, and flushPendingScrollToBottom() never hides the pill or clears the stale offset. Furthermore, any subsequent onContentSizeChange callback after flushPendingScrollToBottom() will continue reading the stale scrollOffsetRef.current > ACTION_VISIBLE_THRESHOLD and re-showing the pill.
What changes do you think we should make in order to solve the problem?
In src/hooks/useReportActionsScroll.ts inside flushPendingScrollToBottom (lines 426-433), reset scrollOffsetRef.current = 0 and call setIsFloatingMessageCounterVisible(false) when flushing the pending scroll to the bottom:
const flushPendingScrollToBottom = () => {
if (!isScrollToBottomEnabled) {
return;
}
scrollOffsetRef.current = 0;
setIsFloatingMessageCounterVisible(false);
reportScrollManager.scrollToBottom();
setIsScrollToBottomEnabled(false);
completeLiveTailPruneAfterScrollToBottom();
};
Resetting scrollOffsetRef.current = 0 and hiding the floating message counter in flushPendingScrollToBottom ensures that:
- Even if
onContentSizeChangerantrackVerticalScrolling(undefined)right beforeflushPendingScrollToBottom()(or whileisScrollToBottomEnabledwas queued), the pill is hidden once the jump to the bottom is flushed. - Any subsequent
onContentSizeChange(trackVerticalScrolling(undefined)) seesscrollOffsetRef.current === 0(matching the actual bottom position of the list) and does not re-enable the pill until the user actually scrolls up in history.
What alternative solutions did you consider?
We considered resetting scrollOffsetRef.current = 0 when listID changes in useReportActionsListScroll.ts, or swapping the order of flushPendingScrollToBottom() and trackVerticalScrolling(undefined) in onContentSizeChange. However, onContentSizeChange can also fire on the render before the queueMicrotask(() => setIsScrollToBottomEnabled(true)) state update commits, and flushPendingScrollToBottom is also called from onLayout and non-remount live-tail jumps (where hasNewerActions was true without a linkedReportActionID change). Synchronizing scrollOffsetRef.current = 0 and setIsFloatingMessageCounterVisible(false) directly inside flushPendingScrollToBottom() handles both deep-link remount jumps and in-place live-tail jumps in one place.
Proposal
Please re-state the problem that we are trying to solve in this issue
When opening a chat from a deep link to an old message and then sending a message, the chat list jumps to the newest messages at the bottom, but the "Latest messages" floating pill remains visible instead of disappearing.
What is the root cause of that problem?
- When a chat is opened from a deep link (
linkedReportActionIDin route params),<InvertedFlashList key={listID} />mounts atinitialScrollIndex = targetIndex(> 0). ItsonScrollhandler (trackScrollPositionAndThresholdinsrc/pages/inbox/report/ReportActionsList/useReportActionsListScroll.ts, lines 146-149) setsscrollOffsetRef.current(stored inActionListContextProvider,src/pages/inbox/ActionListContext.tsx, line 53) to the deep-linked scroll offset (> CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLD) and callsonScrolledOverThresholdChange(true)(hasScrolledOverThreshold = trueinReportActionsListContent.tsx, line 119). OnceonLoadruns (src/hooks/useReportActionsScroll.ts, lines 436-443),updatePillVisibility()seescurrentVerticalScrollingOffsetRef.current > CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLDand setsisFloatingMessageCounterVisible = true. - When the current user sends a message while viewing the deep-linked message,
scrollToBottomForCurrentUserActioninsrc/pages/inbox/report/useReportActionsNewActionLiveTail.ts(lines 125-136) enters theshouldJumpToLiveTailbranch (!!linkedReportActionIDistrue), setsliveTailJumpRef.current = {stage: 'open_report'}, and callsopenReportAtLiveTail(). - When
openReportfinishes (prevIsLoadingInitialReportActions === true && reportLoadingState?.isLoadingInitialReportActions === false), two separate effects inuseReportActionsNewActionLiveTail.tsrun across consecutive renders:- First, the effect at lines 191-205 runs:
setTreatAsNoPaginationAnchor(true); clearLinkedActionParam(); liveTailJumpRef.current = {stage: 'await_scroll'};clearLinkedActionParam()callsnavigation.setParams({reportActionID: ''}), changinglinkedReportActionIDto''. - In the render caused by
setTreatAsNoPaginationAnchor(true)andclearLinkedActionParam(),listIDinuseReportActionsListScroll.ts(line 71:[reportID, linkedReportActionID, ...].join(':')) changes immediately. This unmounts the deep-linked<InvertedFlashList key={listID} />and mounts a brand-new<InvertedFlashList>instance at scroll offset0(initialScrollIndex = undefined). - Crucially, during the render in which the new
<InvertedFlashList>mounts and fires its initialonLayoutandonContentSizeChange,isScrollToBottomEnabledis stillfalse, because the second effect at lines 207-221:
only runs afterliveTailJumpRef.current = {stage: 'await_prune'}; setIsFloatingMessageCounterVisible(false); queueMicrotask(() => { setIsScrollToBottomEnabled(true); });hasNewestReportActionbecomestrue(oncetreatAsNoPaginationAnchoristrue), and then further deferssetIsScrollToBottomEnabled(true)inside aqueueMicrotask.
- First, the effect at lines 191-205 runs:
- Because the remounted
<InvertedFlashList>starts at offset0, it never emits anonScrollevent. Meanwhile,scrollOffsetRef.currentinActionListContextProviderstill holds the stale deep-linked offset (> CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLD), andhasScrolledOverThresholdinReportActionsListContentremainstrue(which also leavesmaintainVisibleContentPosition.disabled = falseanduseMarkAsRead'sisScrolledToEnd = false). - When
onContentSizeChangefires on the list (useReportActionsListScroll.ts, lines 214-217):onContentSizeChange: () => { trackVerticalScrolling(undefined); flushPendingScrollToBottom(); },- If
onContentSizeChangefires before thequeueMicrotasksetsisScrollToBottomEnabled = true,flushPendingScrollToBottom()returns early atif (!isScrollToBottomEnabled) return;. And onceisScrollToBottomEnabledflips totrueon the subsequent render, if layout and content size have already settled on the remounted list,flushPendingScrollToBottom()(andcompleteLiveTailPruneAfterScrollToBottom()) does not run until a future layout/content-size event. - And whenever
onContentSizeChangeruns (either during initial layout or afterpruneReportActionPagesToNewestWindowprunes older pages),trackVerticalScrolling(undefined)callsupdatePillVisibility()(src/pages/inbox/report/useReportUnreadMessageScrollTracking.ts, lines 98-110), which reads the stalecurrentVerticalScrollingOffsetRef.current > CONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLDand immediately callssetIsFloatingMessageCounterVisible(true), turning the "Latest messages" pill back on.
- If
- Offending PR / Regression History:
- In PR #90072 (
4ac01f2d, Open reports at first unread action V2),key={listID}was originally placed on<ReportActionsList key={listID} />inReportActionsView.tsx. - In PR #94149 (
856bc8e1, Decompose ReportActionsList: 10),key={listID}was moved down onto<InvertedFlashList key={listID} />whileReportActionsListContentwas keyed bykey={reportID}, souseReportActionsScroll,useReportUnreadMessageScrollTracking, andActionListContext'sscrollOffsetRef.currentremained mounted whenclearLinkedActionParam()remounted<InvertedFlashList key={listID} />at offset0. - In PR #100793 (
088b2bb3, Show the Latest messages pill in a read chat when scrolled up past the visible threshold), the pill threshold inuseReportUnreadMessageScrollTracking.tswas lowered fromLATEST_MESSAGES_PILL_SCROLL_OFFSET_THRESHOLD(2000) toACTION_VISIBLE_THRESHOLD(250), causingtrackVerticalScrolling(undefined)ononContentSizeChangeto re-show the pill whenever the stale deep-linkedscrollOffsetRef.current > 250. (PR #103174 /2403f672and PR #104845 /c9084eb8further wiredflushPendingScrollToBottom()aftertrackVerticalScrolling(undefined)inonContentSizeChangeand added the offline linked-action anchor release; PR #104242 /bc5e11dfon the current staging checklist #105971 only refactoredopenReportAtLiveTailto read Onyx inputs viaOnyx.multiGet/Onyx.get, which is why the regression test on #104242 surfaced this pre-existing behavior.)
- In PR #90072 (
What changes do you think we should make in order to solve the problem?
- Reset
scrollOffsetRef.currentandhasScrolledOverThresholdwhen releasing the linked-action anchor and jumping to the live tail:- Pass
onScrolledOverThresholdChangeintouseReportActionsScrolland expose aresetScrollToBottomStatecallback (which setsscrollOffsetRef.current = 0, callsonScrolledOverThresholdChange(false), and callssetIsFloatingMessageCounterVisible(false)) touseReportActionsNewActionLiveTail. - In
src/pages/inbox/report/useReportActionsNewActionLiveTail.ts, callresetScrollToBottomState()when releasing the linked-action anchor (in theopen_reportcompletion effect at lines 202-204, theawait_scrolleffect at lines 215-220, and the offline linked-action send branch at lines 139-143) so thatscrollOffsetRef.currentis0andhasScrolledOverThresholdisfalsebefore the remounted<InvertedFlashList key={listID} />mounts and runsonContentSizeChange.
- Pass
- Flush pending scroll-to-bottom when
isScrollToBottomEnabledbecomestrueand reset scroll state insideflushPendingScrollToBottom:- In
src/hooks/useReportActionsScroll.tsinsideflushPendingScrollToBottom(lines 426-433), also callresetScrollToBottomState(), and invokeflushPendingScrollToBottom()from an effect whenisScrollToBottomEnabledbecomestrue(once the list ref is laid out) so the scroll and pagination prune are not missed ifonLayout/onContentSizeChangealready fired before thequeueMicrotaskrender:const flushPendingScrollToBottom = () => { if (!isScrollToBottomEnabled) { return; } scrollOffsetRef.current = 0; onScrolledOverThresholdChange(false); setIsFloatingMessageCounterVisible(false); reportScrollManager.scrollToBottom(); setIsScrollToBottomEnabled(false); completeLiveTailPruneAfterScrollToBottom(); };
- In
- Run
flushPendingScrollToBottom()beforetrackVerticalScrolling(undefined)inonContentSizeChange:- In
src/pages/inbox/report/ReportActionsList/useReportActionsListScroll.ts(lines 214-217):onContentSizeChange: () => { flushPendingScrollToBottom(); trackVerticalScrolling(undefined); },
- In
What alternative solutions did you consider?
- Only resetting
scrollOffsetRef.current = 0insideflushPendingScrollToBottom(): This is not sufficient on its own becauseclearLinkedActionParam()remounts<InvertedFlashList key={listID} />in the render beforequeueMicrotask(() => setIsScrollToBottomEnabled(true))commits, soisScrollToBottomEnabledis stillfalsewhen the remounted list fires its initialonLayoutandonContentSizeChange, andhasScrolledOverThresholdinReportActionsListContentwould also staytrue(leavingmaintainVisibleContentPositionenabled anduseMarkAsRead'sisScrolledToEndasfalse). - Resetting
scrollOffsetRef.current = 0inActionListContext.registerListRefon every unmount/mount:ReportActionsListThresholdTestspecifically requiresscrollOffsetRef.currentto persist across mount when preserving scroll position above the threshold. ResettingscrollOffsetRef.current = 0andonScrolledOverThresholdChange(false)specifically during a live-tail / scroll-to-bottom jump preserves mount-time threshold behavior.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After sending from a historical-message deep link, the chat reportedly reaches the newest messages but retains the “Latest messages” pill. The faulty function and exact line remain unverified.
What is the root cause of that problem?
⚠️ Why MelvinBot's proposal is insufficient / introduces regressions:
- It explicitly admits no reproduction or confirmed event sequence; stale-offset reuse remains a hypothesis.
- Resetting tracking on an unconfirmed scroll could hide the pill while the list still displays historical messages.
Verdict: insufficient evidence for implementation approval. The supplied references identify investigation points, not a demonstrated cause. Source retrieval failed, and no local Expensify checkout was available; I could not verify the cited lines.
What changes do you think we should make in order to solve the problem?
First capture the failing sequence: list replacement, content-size callback, pending-jump execution, actual offset, newest-page availability, and pill visibility.
A 3–10-line TypeScript patch is not defensible until that trace identifies the incorrect state transition. Inventing one would violate the required evidence standard.
Compare branch: https://github.com/Expensify/App/compare/main...camesenin:App:fix-issue-106015?expand=1
Branch existence and contents were not verified.
What alternative solutions did you explore? (Optional)
Unconditional offset resets and hiding on send both risk masking an incomplete jump. Synchronizing after confirmed completion also substantially overlaps MelvinBot’s recommendation; it is not an independently established solution.
What automated tests can you add to prevent this from re-occurring?
In the existing list/hook suite, reproduce the observed callback order and require failure before the fix and success afterward. Cover delayed list readiness, absent scroll events, offline sending, and scrolling upward; no tests were executed.
Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@MelvinBot Investigate this issue and write-up a new formal proposal. Find the offending PR if possible (either the latest staging deploy checklist or older).
🤖 Web test steps verification results: ⚠️ partial
Issue 106015 remains unconfirmed on dev NewDot web. The bounded continuation could not expose the anchor’s Copy link menu; no additional fixture messages or source changes were made.
| Step | Status |
|---|---|
1: App opens in handed-over sessionAuthenticated app and self-chat were accessible. |
✅ |
2: Open genuine old-message permalink with newer messages offscreen and Latest messages visibleBlocked. Approximately 60 genuine test messages were created, but the anchor’s Copy link menu could not be exposed. Search preview did not establish the required deep-link viewport or unambiguous pill presence.![]() |
❌ |
3: Send a message; newest messages and sent message become visibleNot verified because the prerequisite old-message state was not established. The probe remains entered but unsent. |
❌ |
4: Latest messages disappears after jumpNot verified. No qualifying send-and-jump occurred; tiny-scroll and pill-click behavior were not tested. No cause is inferred. |
❌ |
Proposal
What is the root cause of that problem?
Probable stale tracking; medium confidence, not reproduced. List replacement preserves historical scroll state; content-size callbacks can restore the pill.
What changes do you think we should make in order to solve the problem?
Reconcile offset, threshold and pill only after the loaded newest list reports bottom positioning. Retain pending work otherwise. Scope readiness/enablement retries to live-tail jumps, excluding REPORT_PREVIEW.
Test absent scroll events, delayed readiness, mount restoration and upward scrolling.
Evidence and offending-PR investigation
- useReportActionsListScroll.ts:214–217 tracks before flushing; useReportActionsScroll.ts:426–433 does not reconcile tracking.
- Historical origin: Open reports at first unread action V2 (May 11 checklist). Not a proven offender.
- Latest checklist: Read the Concierge chat on press changes fetch timing, not this mechanism.
Web reproduction remained blocked; no parent-versus-merge comparison establishes an offender.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106015) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Problem: Opening a chat via a deep link to an older message shows the "Latest messages" pill, as expected. Sending a new message jumps the list to the newest messages at the bottom, but the pill stays visible even though the user is already at the latest messages.
Root cause: The live-tail jump in useReportActionsNewActionLiveTail.ts clears the linked action param, which changes listID and remounts InvertedFlashList at the bottom — but ActionListContext's scrollOffsetRef lives above the list, so it still holds the stale deep-link offset (above ACTION_VISIBLE_THRESHOLD). When the remounted list fires onContentSizeChange, trackVerticalScrolling(undefined) runs updatePillVisibility() without updating scrollOffsetRef, so it reads the stale offset and re-shows the pill that the jump had just hidden. No subsequent native onScroll fires (the list is already at offset 0), so the stale offset is never corrected.
Fix: In flushPendingScrollToBottom (src/hooks/useReportActionsScroll.ts), when flushing the pending scroll to the bottom, reset scrollOffsetRef.current = 0 and call setIsFloatingMessageCounterVisible(false) before scrolling, so the pill state matches the actual bottom position and later onContentSizeChange calls see offset 0 instead of the stale deep-link offset. This single point covers both deep-link remount jumps and in-place live-tail jumps, since both go through this flush.
Verification: Deep-link to an older message, send a message, and confirm the pill disappears and stays disappeared; scroll up afterwards and confirm the pill reappears only on genuine upward scroll; confirm normal (non-deep-linked) live-tail jumps are unchanged. Add a test for the deep-link send flow asserting the pill is hidden after the flush and scrollOffsetRef is 0.
@MelvinBot Investigate this issue and write-up a new formal proposal. Find the offending PR if possible (either the latest staging deploy checklist or older).
🤖 Web test steps verification results: ⚠️ partial
Onboarding completed on dev NewDot web. Reproduction was blocked while obtaining a genuine message permalink; product behavior remains unverified.
| Step | Status |
|---|---|
VERIFY1: Authenticated app opensCompleted onboarding. Authenticated Home, Inbox, and self-chat rendered. |
✅ |
VERIFY2: Genuine old-message deep link with newer messages offscreen and Latest messages visibleBlocked, not a product failure. Created a self-chat anchor message, but obtained no genuine permalink. Required state remains unverified.![]() |
❌ |
VERIFY3: Sending reveals newest and sent messageUnverified: required deep-link precondition was not established. |
❌ |
VERIFY4: Latest messages pill disappearsUnverified: required precondition was not established. Tiny-scroll/pill-click correction was not tested. |
❌ |
Proposal
Updated November 5, 2026: Corrected based on feedback from ikevin127.
What is the root cause of that problem?
The saved scroll offset stays at the historical deep-link position after the list jumps to the newest messages, confirmed by ikevin127’s local reproduction and logging. Subsequent content-size callbacks reuse that stale offset and show the “Latest messages” pill again.
What changes do you think we should make in order to solve the problem?
In flushPendingScrollToBottom, immediately after reportScrollManager.scrollToBottom():
- Set
scrollOffsetRef.current = 0. - Call
setIsFloatingMessageCounterVisible(false).
Keep the existing enabled guard, pending-scroll reset and pagination-pruning call unchanged. Add the explanatory comment about remounted live-tail lists not emitting a correcting scroll event. No offset accessor, shared-ref type changes, onLoad reconciliation or additional scheduling changes are needed for this fix.
Code references and regression test
- Change src/hooks/useReportActionsScroll.ts:426–433.
- src/hooks/useReportScrollManager/index.ts:25–32 requests non-animated index 0. The flush’s production callers are the list’s layout/content-size callbacks in src/pages/inbox/report/ReportActionsList/useReportActionsListScroll.ts:200–216.
- Add a case to the
flushPendingScrollToBottomblock in tests/unit/useReportActionsScrollTest.tsx:477–503: enable flushing, seed the shared offset aboveCONST.REPORT.ACTIONS.ACTION_VISIBLE_THRESHOLD, set the mocked pill visible, render, and flush insideact. Assert the offset becomes 0 and the pill setter receivesfalse, alongside the existing scroll/disable/prune expectations. Assert the setter call rather than a changed return value because the current setter mock is not stateful.
This is the revised implementation/test plan; no source changes or new test execution are claimed here. The introducing PR remains unconfirmed; the previously checked key-boundary history is unchanged.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106015#issuecomment-6646814996) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
@MelvinBot Root cause confirmed: I reproduced it locally and logged scrollOffsetRef staying at the deep-link offset through the whole jump. Update your proposal to go with the simpler fix instead of the offset accessor. scrollToBottom is a non-animated scrollToIndex({index: 0}), and the flush only runs from the list's own onLayout/onContentSizeChange, so 0 is the real position at that point:
const flushPendingScrollToBottom = () => {
if (!isScrollToBottomEnabled) {
return;
}
reportScrollManager.scrollToBottom();
// A list remounted for the live tail already sits at the bottom, so no scroll event corrects the offset left
// by the linked message. Sync it here, or the next content size change shows the Latest messages pill again.
scrollOffsetRef.current = 0;
setIsFloatingMessageCounterVisible(false);
setIsScrollToBottomEnabled(false);
completeLiveTailPruneAfterScrollToBottom();
};
Add a case to the flushPendingScrollToBottom block in tests/unit/useReportActionsScrollTest.tsx: a stale offset above the threshold, flush, then assert the offset is 0 and the pill was hidden.
Updated the proposal in place using your confirmed reproduction.
- Reset the saved offset to
0and hide the pill immediately afterscrollToBottom(), preserving the guard and pruning logic. - Removed the offset-accessor/onLoad approach.
- Specified the regression case: start above the threshold, flush, then assert offset
0and the pill setter called withfalse.
This updates the proposal and test plan only; no source changes or new tests were run.
Triggered auto assignment to @NicolasBonet, see https://stackoverflow.com/c/expensify/questions/7972 for more details.