Skip to content

[Due for payment 2026-06-03] [Due for payment 2026-05-26] [Due for payment 2026-05-26] Unable to edit sent message in narrow screen when room posting permission is disabled #90889

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: 9.3.75-1
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #90516
Email or phone of affected tester (no customers): sdjoinsjdosjiondsoj2@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Chat Report View

Action Performed:

Precondition:

  • Admin creates a room and invites member to the room.
  1. Go to staging.new.expensify.com
  2. [Member] Send a message in the invited room.
  3. [Admin] Click on the room header > Settings > Who can post.
  4. [Admin] Select Admins only.
  5. [Member] Wait for "Only admins can send messages in this room" to show up in the room.
  6. [Member] Resize screen to narrow on web. Skip this step on mweb, Android and iOS.
  7. [Member] Right click on the message from Step 2 > Edit comment.

Expected Result:

Member can edit sent message in narrow screen when room posting permission is disabled.

Actual Result:

Member cannot edit sent message in narrow screen when room posting permission is disabled.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @hungvu193

Activity

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

    @melvin-bot

    @mountiny recently merged #90516, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on May 16, 2026

    @melvin-bot

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

  4. melvin-bot commented on May 16, 2026

    @melvin-bot

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

  5. github-actions commented on May 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.
  6. OSBotify commented on May 16, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #90516 - "Allow editing messages in Composer on narrow screens V2" by @chrispader (High confidence)
    Related Issues: #64085, #90512, #90444, #90492, #90435, #90433, #90431, #90430

    Recommendation: REVERT

    PR #90516 introduced narrow-screen editing that routes the edit flow through the bottom composer, but non-admin members in admins-only rooms never have the bottom composer rendered — they see only an admins-only banner. Reverting this PR restores the previous inline editing behavior, which worked correctly for this case.

    Assigned: @chrispader (PR author), @hungvu193, @mountiny (approving reviewers)
    Labels: DeployBlockerCash kept (Frontend bug — App PR is the cause). No label changes made.

    Detailed Analysis

    Evidence

    Verification

    • ReportFooter.tsx is the affected file. When isAdminsOnlyPostingRoom returns true and the user is not a policy admin, shouldHideComposer is true and the ReportActionCompose component (bottom composer) is never rendered. Instead, an admins-only banner is shown.
    • canUserPerformWriteAction calls isAllowedToComment, which calls isAdminsOnlyPostingRoom (checks writeCapability === CONST.REPORT.WRITE_CAPABILITIES.ADMINS). For non-admin members this returns false, causing the composer to be hidden.
    • PR Allow editing messages in Composer on narrow screens V2 #90516 modifies ReportActionCompose/, ReportFooter.tsx, ReportActionsList.tsx, ReportActionItemMessageEdit.tsx, and introduces useEditComposerToggle.ts and useActiveDraftReportAction.ts — all directly related to the editing flow in narrow vs. wide screens.
    • The PR's ComposerProvider.tsx sets isEditingInComposer = shouldUseNarrowLayout && editingState !== 'off', routing all narrow-screen edits through the bottom composer.

    Root Cause

    Before PR #90516, message editing on narrow screens used inline editing within the message list (the ReportActionItemMessageEdit component). This worked regardless of the room's posting permissions because editing an existing message does not require the bottom composer.

    PR #90516 changed narrow-screen editing to use the bottom composer instead. However, for non-admin members in admins-only posting rooms, canUserPerformWriteAction returns false because isAllowedToComment returns false for the admins-only write capability. This means ReportFooter renders only the admins-only banner and does not render ReportActionCompose. When a non-admin member tries to edit their previously sent message on a narrow screen, the edit state is triggered but the bottom composer is absent, so the edit cannot be completed.

  7. MelvinBot commented on May 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #90516 moved narrow-screen message editing from an inline editor (rendered per-message) to the main bottom composer. In admin-only rooms, ReportFooter never mounts ReportActionCompose for non-admin members — it renders an "Only admins can send messages" banner instead (ReportFooter.tsx:155-170). When the user clicks "Edit comment", a draft is saved to Onyx, but no mounted component consumes it because the composer tree (ComposerProvider → useEditComposerToggle) is absent.

    The key line is in ChatMessageContent.tsx:82: const isEditingInline = !shouldUseNarrowLayout && draftMessage !== undefined; — on narrow screens isEditingInline is always false, so inline editing never activates, and the edit relies entirely on the bottom composer which isn't rendered.

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

    In ReportFooter.tsx, when the composer is hidden (admin-only room, non-admin user) but the user has an active edit draft, we should still render ReportActionCompose so the edit-in-composer flow works. The admin-only restriction should block new messages but not editing of the user's own existing messages.

    Concretely: in the admin-only branch (~line 155), check if there is an active edit draft (via useActiveDraftReportAction or equivalent). If so, render ReportActionCompose instead of the banner. The composer's edit mode will handle showing the edit UI, and useEditComposerToggle will correctly populate it with the draft.

    What alternative solutions did you explore? (Optional)

    An alternative is to allow inline editing on narrow screens when the composer is hidden — i.e., modify ChatMessageContent.tsx:82 to fall back to inline editing when shouldHideComposer is true. This avoids touching ReportFooter but partially reverses the intent of #90516 for this edge case.

    Investigation details

    Data flow on narrow screens after PR #90516:

    1. User right-clicks own message → "Edit comment" appears (canEditReportAction doesn't check write permissions)
    2. saveReportActionDraft() sets REPORT_ACTIONS_DRAFTS in Onyx
    3. On wide screens: ChatMessageContent.tsx:82 sets isEditingInline=true → inline editor renders ✅
    4. On narrow screens: isEditingInline is always false → draft should be consumed by useEditComposerToggle in the bottom composer
    5. But ReportFooter.tsx:75-76 sets shouldHideComposer=true because canUserPerformWriteAction returns false for non-admins in admin-only rooms
    6. ReportFooter.tsx:155 renders the banner instead of ReportActionCompose → no composer mounted → draft has no consumer → nothing happens

    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.

  8. 15 remaining items

  9. melvin-bot commented on May 19, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.77-3 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-05-26. 🎊

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

    • @hungvu193 requires payment through NewDot Manual Requests
    • @chrispader does not require payment (Contractor)
  10. melvin-bot commented on May 19, 2026

    @melvin-bot

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

  11. changed the title [-][Due for payment 2026-05-26] [Due for payment 2026-05-26] Unable to edit sent message in narrow screen when room posting permission is disabled[/-] [+][Due for payment 2026-06-03] [Due for payment 2026-05-26] [Due for payment 2026-05-26] Unable to edit sent message in narrow screen when room posting permission is disabled[/+] on May 27, 2026
  12. melvin-bot commented on May 27, 2026

    @melvin-bot

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

  13. melvin-bot commented on May 27, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.83-3 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-06-03. 🎊

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

    • @hungvu193 requires payment through NewDot Manual Requests
    • @chrispader does not require payment (Contractor)
  14. melvin-bot commented on May 27, 2026

    @melvin-bot

    @hungvu193 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.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions