Skip to content

[$250] mWeb – Compose box closes after sending messages #83731

Closed

Description

@jponikarchuk

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.27-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-7031/folder/13176723/41237032/1218506729
Email or phone of affected tester (no customers): applausetester+tesaydb@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: mweb
App Component: Other

Action Performed:

  1. Open the mWeb app.
  2. Open any chat.
  3. Send a message.

Expected Result:

The compose box should remain open after sending a message

Actual Result:

The compose box closes automatically every time a message is sent.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @parasharrajat
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022027429603485128540
  • Upwork Job ID: 2027429603485128540
  • Last Price Increase: 2026-02-27

Activity

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

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. github-actions commented on Feb 27, 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.
  4. melvin-bot commented on Feb 27, 2026

    @melvin-bot

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

  5. melvin-bot commented on Feb 27, 2026

    @melvin-bot

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

  6. OSBotify commented on Feb 27, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug (requires investigation)
    Causing PR: Unable to determine with high confidence
    Related Issues: None identified

    Recommendation: NEEDS INVESTIGATION

    The root cause cannot be determined with confidence from the available evidence. The compose box closing after sending messages on mWeb Android Chrome is likely an indirect side-effect from another change in the staging deploy.

    Reasoning:

    • No direct changes to ReportActionCompose, ComposerWithSuggestions, or SendButton components were found in the staging deploy
    • No modifications to willBlurTextInputOnTapOutside, KeyboardUtils, or ComposerFocusManager libraries
    • The bug is staging-only (not reproducible in production), confirming it was introduced in v9.3.27-0
    • The behavior suggests something is causing the compose input to blur/lose focus after message submission, but the blur logic itself appears unchanged

    Investigation performed:

    • Reviewed all 100 PRs in the v9.3.27-0 staging deploy checklist
    • Searched for PRs affecting composer, keyboard, blur, focus, and mWeb-specific behavior
    • Checked recent commits to composer-related files and focus/blur utilities
    • No PRs in the staging deploy directly modify the compose box or message sending flow

    Next steps:

    1. Tag the original issue reporter @jponikarchuk for additional context
    2. Test if the issue reproduces when reverting recent PRs one by one
    3. Check if there are any timing-related changes (debounce, setTimeout) that might affect the blur behavior
    4. Investigate if changes to navigation, screen transitions, or keyboard handling could indirectly affect the composer

    Labels: No label changes at this time - keeping DeployBlockerCash until root cause is identified

    cc @jponikarchuk @sonialiap @blimpich - Unable to identify a specific causing PR. This requires deeper investigation, potentially reverting recent PRs to bisect the issue.

  7. MelvinBot commented on Feb 27, 2026

    @MelvinBot
    Contributor

    🔍 Issue Analysis

    Summary: After sending a message on mWeb (Android Chrome), the compose box closes. This is a regression in staging v9.3.27-0, not present in production.

    Root Cause: Two changes in this release combine to cause the bug:

    1. PR #81280 ("Report Actions Derived Value") introduces an async Onyx-derived value VISIBLE_REPORT_ACTIONS that ReportActionsView subscribes to. When a message is sent, the optimistic REPORT_ACTIONS update triggers an async recomputation of this derived value, which causes ReportActionsView to re-render a second time when the derived value settles. On mWeb Android Chrome, this additional re-render (combined with the resetHeight() and async scheduleOnUI-based input clear) causes a layout shift that triggers the browser to dismiss the virtual keyboard, making the compose box appear to "close."

    2. PR #76104 changes chatContentScrollViewPlatformStyles from overflow: 'hidden' to overflow: 'clip' on web (src/styles/utils/chatContentScrollViewPlatformStyles/index.ts). This changes how the chat content area handles overflow — overflow: clip does not create a formatting context the way overflow: hidden does, which affects how Android Chrome handles viewport/keyboard interactions during layout shifts.

    Key evidence:

    • ReportActionsView.tsx:105 subscribes to ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS (new in PR Report Actions Derived Value #81280)
    • ReportActionsView.tsx:241 — visibleReportActions useMemo depends on visibleReportActionsData, so any derived value update triggers recomputation
    • ReportActionsView.tsx:333-335 — a hasDerivedValueTimingIssue guard renders a non-animated skeleton if reportActions.length > 0 but visibleReportActions.length === 0. If this guard triggers even briefly on mWeb, it unmounts the ReportActionsList from the DOM entirely
    • src/styles/utils/chatContentScrollViewPlatformStyles/index.ts — changed from overflow: 'hidden' to overflow: 'clip' (PR fix: Allow multiple loads in useLoadReportActions hook #76104), applied at ReportActionsList.tsx:834
    • PR fix: Allow multiple loads in useLoadReportActions hook #76104 also removes the didLoadNewerChats one-shot guard in useLoadReportActions, allowing loadNewerChats to fire multiple times, potentially triggering more Onyx updates and re-renders after sending

    Recommended Fix:

    1. Quickest test: Revert the overflow: 'hidden' → overflow: 'clip' change in src/styles/utils/chatContentScrollViewPlatformStyles/index.ts and check if the issue resolves on mWeb
    2. If needed: Optimize the visibleReportActions useMemo in ReportActionsView.tsx to only depend on the specific report's data from the derived value (not the entire object), reducing unnecessary re-renders
    3. If the skeleton flashes: The hasDerivedValueTimingIssue guard at ReportActionsView.tsx:333 could use the previous visibleReportActions value as a fallback instead of showing a skeleton, preventing DOM unmount/remount on mWeb

    Open Questions

    • Runtime confirmation is needed: does the hasDerivedValueTimingIssue skeleton guard actually trigger after sending a message on mWeb, or is the issue purely from re-render layout shifts?
    • Is this also reproducible on iOS mWeb Safari? The bug report only checks Android mWeb Chrome.
    Detailed Investigation

    Evidence Chain

    Message send flow on mWeb:

    1. User taps Send → handleSendMessage in ReportActionCompose.tsx
    2. composerRef.current?.resetHeight() shrinks composer to empty height
    3. scheduleOnUI(clearWorklet) queues the input clear for next animation frame (async via requestAnimationFrame on web per react-native-worklets/src/threads.ts:92)
    4. Optimistic REPORT_ACTIONS update fires → reportActions from usePaginatedReportActions includes new action
    5. visibleReportActions useMemo recomputes → new action visible (has pendingAction → bypasses derived value per ReportActionsUtils.ts:1209)
    6. ASYNC: VISIBLE_REPORT_ACTIONS derived value recomputes (triggered by REPORT_ACTIONS change)
    7. When derived value settles → visibleReportActionsData changes → visibleReportActions useMemo recomputes AGAIN
    8. This second re-render, combined with the height reset from step 2 and the async clear from step 3, causes layout thrashing
    9. On Android Chrome mWeb, the browser dismisses the virtual keyboard due to the layout shifts
    10. Without the keyboard, the compose box appears "closed"

    Why mWeb Android Chrome specifically:

    • Android Chrome is aggressive about dismissing the virtual keyboard when DOM layout changes significantly
    • The overflow: 'clip' change (PR fix: Allow multiple loads in useLoadReportActions hook #76104) removed the scroll formatting context from the chat content area, making the layout less stable during re-renders
    • Desktop browsers don't have virtual keyboards, iOS Safari has different keyboard management

    Relevant Code

    • src/pages/inbox/report/ReportActionsView.tsx:105 — subscribes to derived value
    • src/pages/inbox/report/ReportActionsView.tsx:220-242 — visibleReportActions useMemo with visibleReportActionsData dependency
    • src/pages/inbox/report/ReportActionsView.tsx:333-335 — skeleton guard for derived value timing issue
    • src/libs/ReportActionsUtils.ts:1196-1232 — isReportActionVisible with derived value fallbacks
    • src/libs/actions/OnyxDerived/configs/visibleReportActions.ts — new derived value config (PR Report Actions Derived Value #81280)
    • src/styles/utils/chatContentScrollViewPlatformStyles/index.ts — overflow: 'clip' change (PR fix: Allow multiple loads in useLoadReportActions hook #76104)
    • src/hooks/useLoadReportActions.ts — removed one-shot guard (PR fix: Allow multiple loads in useLoadReportActions hook #76104)

    PRs Involved

    PR Title Risk Level
    #81280 Report Actions Derived Value High — extra async re-renders after message send
    #76104 Allow multiple loads in useLoadReportActions Medium — overflow style change + more API calls
    #82587 Migration from InteractionManager to TransitionTracker Low — timing changes in keyboard dismiss

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Feb 27, 2026
  9. 6 remaining items

  10. parasharrajat commented on Feb 27, 2026

    @parasharrajat
    Member

    @chrispader @ishpaul777 regression from your PR.

  11. added a commit that references this issue on Feb 27, 2026
    ee6244e
  12. blimpich commented on Feb 27, 2026

    @blimpich
    Contributor
  13. melvin-bot commented on Feb 27, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  14. blimpich commented on Feb 28, 2026

    @blimpich
    Contributor

    deployed fix to staging, requested retest here: https://expensify.slack.com/archives/C09V78U42D8/p1772237489391169

  15. m-natarajan commented on Feb 28, 2026

    @m-natarajan

    Issue is not reproducible on Samsung S23FE/ Chrome in v9.3.27-2

    83731.mp4
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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions