Skip to content

IOU - Page jumps when Hold expense #85888

Closed

Description

@lanitochka17

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.41-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: https://test-management.browserstack.com/projects/2219752/test-runs/TR-10911/folder/13176872/41237334/1264591235?sort=%2Bstatus_id
Email or phone of affected tester (no customers): gocemate+b215490617@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 10/Chrome
App Component: Other

Action Performed:

Precondition: Owner of workspace invite employee and approver

  1. Employee submit 2 expenses to workspace chat
  2. Employee/approver hold one of the expenses

Expected Result:

Page should no jump

Actual Result:

Page jumps when hold expense

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7107818_1773962253062.Recording__545.mp4

View all open jobs on GitHub

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Mar 20, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 20, 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 Mar 20, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When an employee/approver holds one of the expenses in a workspace chat, the page jumps unexpectedly. The scroll position should remain stable when holding an expense.

    What is the root cause of that problem?

    When holding an expense, putOnHold() in src/libs/actions/IOU/Hold.ts:322 calls:

    notifyNewAction(currentReportID, undefined, true)
    

    The action parameter is undefined. This triggers scrollToBottomForCurrentUserAction in src/pages/inbox/report/ReportActionsList.tsx:559-599. Because action is undefined, it falls into the else branch at line 590-593:

    } else {
        setIsFloatingMessageCounterVisible(false);
        reportScrollManager.scrollToBottom();
    }

    This unconditionally calls scrollToBottom(), which performs a non-animated instant scroll to offset 0 (bottom of inverted list). Additionally, line 595 sets isScrollToBottomEnabled = true, which triggers yet another scroll on the next layout event (lines 812-818).

    The auto-scroll effect at lines 416-428 may also contribute -- when hold adds new optimistic actions to the transaction thread (HOLD action + comment), and the report uses getCombinedReportActions to merge transaction thread actions into the visible list, sortedVisibleReportActions.length changes, which can trigger another scrollToBottom() call.

    The core issue is that notifyNewAction is designed for new messages where scrolling to bottom makes sense, but holding an expense is an in-place state change where the scroll position should be preserved.

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

    Remove the notifyNewAction call at src/libs/actions/IOU/Hold.ts:322. Holding/unholding an expense is not a new message action that warrants scrolling the user to the bottom of the chat. The line:

    Navigation.setNavigationActionToMicrotaskQueue(() => notifyNewAction(currentReportID, undefined, true));
    

    should be removed from the putOnHold function.

    The same pattern should also be checked in unholdRequest at line 530:

    notifyNewAction(currentReportID, undefined, true);
    

    Both of these trigger unnecessary scroll-to-bottom jumps when the user holds or unholds an expense.

    What alternative solutions did you explore? (Optional)

    An alternative would be to pass the actual HOLD report action as the second argument to notifyNewAction, and then add a check in scrollToBottomForCurrentUserAction to skip scrolling for HOLD/UNHOLD action types. However, removing the call entirely is simpler and more correct -- hold/unhold is a status change, not a new conversation message, so notifying the chat of a "new action" is semantically wrong.


    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. cristipaval commented on Mar 20, 2026

    @cristipaval
    Contributor

    Asked for a retest here

  7. IuliiaHerets commented on Mar 20, 2026

    @IuliiaHerets

    Windows 10 / Chrome
    v9.3.41-3
    Not Repro

    repro.-.85888.mp4
  8. cristipaval commented on Mar 20, 2026

    @cristipaval
    Contributor

    Thanks, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions