Skip to content

[Due for payment 2026-04-30] [Due for payment 2026-04-28] Web - Comment/ expense not highlighted when hovered upon in a conversation after pasting #88087

Closed

Description

@nlemma

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: v9.3.60-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: N/A
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Exploratory - Critical User Impact
Device used: Windows 11/ Chrome
App Component: Chat Report View

Action Performed:

  1. Sign in to staging.new.expensify.com
  2. Navigate to a conversation
  3. Paste a text in compose box and send (copy a comment and paste in the compose box)
  4. Hover over the comments in view

Expected Result:

Each comment is highlighted when hovered upon

Actual Result:

Comments are not highlighted when hovered upon and highlight function only starts working if the user scrolls through the conversation

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7131177_1776323093615.bandicam_2026-04-16_10-03-21-093.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @situchan

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Apr 16, 2026

    @melvin-bot

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

  4. github-actions commented on Apr 16, 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. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After pasting text in the compose box and sending a message, hovering over comments no longer highlights them. Hover highlighting only resumes after the user manually scrolls.

    What is the root cause of that problem?

    Bug in useEmitComposerScrollEvents — when the first scroll event fires, it emits SCROLLING: true but never schedules SCROLLING: false.

    The key logic error is on line 81: the setTimeout that emits SCROLLING: false is only scheduled when lastScrollEvent.current is truthy, but on the first call it's null (initialized on line 21). So lastScrollEvent.current gets set to the timestamp after the check, but the timeout is never created.

    When a message is sent, the list auto-scrolls via scrollToOffset({animated: false, offset: 0}) which fires exactly one scroll event. That single event hits this first-call bug: SCROLLING: true is emitted, SCROLLING: false never follows. ActiveHoverable suppresses all hover updates while isScrollingRef.current is true, so hover highlighting breaks globally.

    Manual scrolling generates multiple scroll events — the second event finds lastScrollEvent.current truthy, properly schedules the timeout, and SCROLLING: false eventually fires, restoring hover.

    This is web-only because the native implementation is a no-op.

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

    Move the lastScrollEvent.current = timestamp assignment before the if (lastScrollEvent.current) check, or remove the guard entirely so the timeout is always scheduled (matching the pattern in useScrollEventEmitter which correctly always schedules the timeout).

    Specifically in src/hooks/useEmitComposerScrollEvents/index.ts, change emitComposerScrollEvents to:

    const emitComposerScrollEvents = () => {
        if (!enabled || !inverted) {
            return;
        }
    
        onScroll();
    
        const timestamp = Date.now();
    
        if (scrollEndTimeout.current) {
            clearTimeout(scrollEndTimeout.current);
        }
    
        // Always schedule the scroll-end timeout (removed the lastScrollEvent.current guard)
        scrollEndTimeout.current = setTimeout(() => {
            if (lastScrollEvent.current !== timestamp) {
                return;
            }
            lastScrollEvent.current = null;
            onScrollEnd();
        }, 250);
    
        lastScrollEvent.current = timestamp;
    };
    Investigation details

    Evidence chain:

    1. PureReportActionItem wraps each action in <Hoverable shouldHandleScroll> (PureReportActionItem.tsx:1648)
    2. ActiveHoverable listens for SCROLLING events and suppresses hover when scrolling is true (ActiveHoverable.tsx:30-32, ActiveHoverable.tsx:50-61)
    3. FlashList wraps the report actions list and calls emitComposerScrollEvents() on every scroll (FlashList/index.tsx:10-14)
    4. After sending a message, scrollToBottom fires a non-animated scroll (useReportScrollManager/index.ts:23-29)
    5. The bug in useEmitComposerScrollEvents means a single scroll event leaves SCROLLING stuck as true

    Comparison with useScrollEventEmitter: The older useScrollEventEmitter hook (used by LHN and other lists) does not have this bug — it always schedules the SCROLLING: false timeout unconditionally on every call.

    Introduced in: PR #87418, which created the useEmitComposerScrollEvents hook.


    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.

  6. mollfpr commented on Apr 16, 2026

    @mollfpr
    Contributor

    @MelvinBot Any regression from the recent PR deployed to staging?

  7. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Yes — this is a regression from #85114 ("Migrate main chat to FlashList with inverted flag" by VickyStash, merged Apr 15 2026).

    That PR created src/components/FlashList/index.tsx, which wraps every FlashList onScroll with useEmitComposerScrollEvents(). The hook has a pre-existing first-call bug (see my proposal above) where a single scroll event emits SCROLLING: true but never schedules SCROLLING: false. Before this PR, the report actions list used FlatList and didn't go through this wrapper, so the bug was never triggered on the chat view.

    After sending a message, the list auto-scrolls via scrollToOffset({animated: false, offset: 0}), which fires exactly one scroll event through the new FlashList wrapper → hits the first-call bug → hover stays permanently suppressed until the user manually scrolls (which generates a second event that clears the stuck state).

  8. mollfpr commented on Apr 16, 2026

    @mollfpr
    Contributor

    @VickyStash could you check this? Thanks!

  9. 8 remaining items

  10. self-assigned this
    on Apr 16, 2026
  11. Julesssss commented on Apr 17, 2026

    @Julesssss
    Contributor

    Verified fixed here

  12. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Apr 21, 2026
  13. changed the title [-]Web - Comment/ expense not highlighted when hovered upon in a conversation after pasting[/-] [+][Due for payment 2026-04-28] Web - Comment/ expense not highlighted when hovered upon in a conversation after pasting[/+] on Apr 21, 2026
  14. melvin-bot commented on Apr 21, 2026

    @melvin-bot

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

  15. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.60-22 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-04-28. 🎊

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

    • @VickyStash does not require payment (Contractor)
    • @situchan requires payment through NewDot Manual Requests
  16. melvin-bot commented on Apr 21, 2026

    @melvin-bot

    @situchan 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]

  17. changed the title [-][Due for payment 2026-04-28] Web - Comment/ expense not highlighted when hovered upon in a conversation after pasting[/-] [+][Due for payment 2026-04-30] [Due for payment 2026-04-28] Web - Comment/ expense not highlighted when hovered upon in a conversation after pasting[/+] on Apr 23, 2026
  18. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.61-4 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-04-30. 🎊

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

    • @VickyStash does not require payment (Contractor)
    • @situchan requires payment through NewDot Manual Requests
  19. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    @situchan 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]

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