Skip to content

LHN - The draft message icon is not displayed, and the message is not preserved in the chat. #96092

Closed

Description

@applause-bot

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: 9.4.34-2
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/64635567/folder/13177075/41237830/1567083520
Email or phone of affected tester (no customers): joelarmandotester+899@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: MacOS 26.3.1 / Chrome
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Go to staging.new.expensify.com
  2. Navigate to any chat or expense details.
  3. Type a message.

Expected Result:

The draft message icon should appear in the LHN, and the message typed in the chat should also be saved.

Actual Result:

The draft message icon is not displayed, and the message is not preserved in the chat

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7208205_1784042762252.Screen_Recording_2026-07-14_at_11.21.18_AM.mov

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7208205

Activity

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

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/b7d63e1dd715401288d1ed1a78b9c7453944e19f0e577ac1fa9a7bac6f105d63

  3. melvin-bot commented on Jul 14, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jul 14, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 14, 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.
  6. roryabraham commented on Jul 14, 2026

    @roryabraham
    Contributor

    looking!

  7. MelvinBot commented on Jul 14, 2026

    @MelvinBot
    Contributor

    ⏱️ Ran out of time before I could finish. This usually means the task was too complex or I got stuck exploring. Please try again with a more specific request or post in #melvinbot-ai.

    Run details

  8. MelvinBot commented on Jul 14, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #93980 - "[No QA] Swap babel-loader + babel-plugin-react-compiler for OXC (Rust React Compiler)" by @roryabraham (High confidence)
    Related Issues: #95833 (Replace Webpack + Babel with Rsbuild + OXC for E/App)

    Recommendation: REVERT

    PR #93980 swaps the app-wide React Compiler from babel-plugin-react-compiler to OXC's Rust React Compiler port; a memoization discrepancy in that port breaks the debounced draft-save hook so reportDraftComment_ is never written to Onyx, which produces both symptoms (composer text not preserved + no LHN draft icon). Reverting restores the previous, working compiler with no source changes needed.

    Assigned: @roryabraham (PR author), @chuckdries (approving reviewer)
    Labels: No changes. DeployBlockerCash is kept (App deploy is correctly blocked by this frontend regression); DeployBlocker was not present.

    📋 Detailed Analysis

    Evidence

    • The bug is a staging-only regression (not on production) affecting draft persistence for any chat — a broad, app-wide failure rather than a feature-specific one.
    • I diffed the entire draft read/write/display chain between production and staging and every relevant source file is byte-identical: ComposerWithSuggestions.tsx, useDebounce.ts, useDebouncedSaveDraft.ts, SilentCommentUpdater/index.tsx, ComposerProvider.tsx, saveReportDraftComment in actions/Report/index.ts, OptionRowLHNData.tsx, and SidebarUtils.ts. None of them changed in this deploy, and react-native-onyx is 3.0.86 on both refs (the 3.0.89 bump in Bump Onyx to 3.0.89 #93436 was reverted).
    • Yet drafts stopped persisting — meaning the regression is in something that transforms all of this code, not the code itself.
    • PR [No QA] Swap babel-loader + babel-plugin-react-compiler for OXC (Rust React Compiler) #93980 is included in this staging deploy (checked in the 9.4.34-2 checklist, Deploy Checklist: New Expensify 2026-07-14 #96044) and is cross-referenced directly from this issue. It touches only build/compiler config — babel.config.js, config/rsbuild/loaders/oxc-react-compiler-loader.mjs, config/rsbuild/rsbuild.common.ts, package.json, etc. — and touches zero draft/composer/LHN source files. This is exactly why the source diffs are clean but runtime behavior regressed.
    • The PR description itself flags the fragility of the new pipeline: the OXC reactCompiler transform is a separate Rust reimplementation, and misconfiguration is "silently a no-op … with no build failure to catch it."

    Verification

    • Affected write path: saveReportDraftComment → Onyx.merge(reportDraftComment_${reportID}, comment || null) (src/libs/actions/Report/index.ts:2969-2971), invoked via the debounced debouncedSaveComment in ComposerWithSuggestions.tsx:300-307, 569-573.
    • Affected read paths (both symptoms share the same Onyx key):
      • Composer restore: SilentCommentUpdater/index.tsx:26 and ComposerProvider.tsx:50 read reportDraftComment_${reportID}.
      • LHN indicator: OptionRowLHNData.tsx:125-126 computes hasDraftComment = !!draftComment from the same key.
    • Confirmed via gh pr view 93980 --json files that the PR modifies compiler/build config exclusively and no Composer|Draft|Report/index|SidebarUtils|useDebounce|LHN files.

    Root Cause

    The React Compiler auto-memoizes callbacks, effects, and derived values across the whole app. The draft save relies on useDebouncedSaveDraft → useDebounce, where useDebounce's useEffect cancels the pending debounced call whenever its func dependency changes identity (src/hooks/useDebounce.ts:28-36). Under the previous babel-plugin-react-compiler, these hook inputs were memoized to stable references so the trailing-edge debounce fired and wrote the draft. The OXC Rust React Compiler port memoizes differently, so the debounced saveReportDraftComment is repeatedly cancelled before DRAFT_SAVE_DEBOUNCE_TIME elapses and the reportDraftComment_ key is never written. Because both the composer restore and the LHN hasDraftComment indicator read that same never-written key, the typed message is lost on navigation and the draft icon never appears.

  9. m-natarajan commented on Jul 14, 2026

    @m-natarajan

    Windows 10 / Chrome
    Repro

    bandicam.2026-07-14.17-01-23-738.mp4
  10. m-natarajan commented on Jul 15, 2026

    @m-natarajan

    Windows 10 / Chrome
    v9.4.34-8
    Issue is not reproducible

    Repro96092Web.mp4
  11. mitarachim commented on Jul 15, 2026

    @mitarachim

    Deploy Blocker #96158 was identified to be related to the PR #96115 that attempted to fix this issue.

  12. mitarachim commented on Jul 15, 2026

    @mitarachim

    Deploy Blocker #96159 was identified to be related to the PR #96115 that attempted to fix this issue.

  13. mitarachim commented on Jul 15, 2026

    @mitarachim

    Deploy Blocker #96161 was identified to be related to the PR #96115 that attempted to fix this issue.

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.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions