Skip to content

[Due for payment 2026-05-22] [Due for payment 2026-05-20] Chat - Unable to delete edited message by removing all the content on composer. #90512

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: 9.3.73-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: #76741
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Other

Action Performed:

Prerequisite: If testing on Web, switch screen to narrow size.

  1. Open the Expensify app.
  2. Open any chat.
  3. Send a message.
  4. Long tap on sent message and select "Edit Message"
  5. Make any edition and send.
  6. Long tap on message again and select "Edit Message"
  7. Delete all the content from composer.
  8. Note that "Send" button changes from green to gray and tapping on it doesn´t trigger "Delete" modal.
  9. Try to select message again.
  10. Note that message cannot be selected.

Expected Result:

Deleting all the content from composer while editing a message and tapping on "Send" should trigger a "Delete" modal.

Actual Result:

After deleting all the content on composer while editing an arleady edited message, send button becomes unresponsive and "Delete" modal doesn´t appear. Also, after this, message can´t be selected again.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7152765_1778667627196.Delete_Modal.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 13, 2026
  2. melvin-bot commented on May 13, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #76741

  3. melvin-bot commented on May 13, 2026

    @melvin-bot

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

  4. github-actions commented on May 13, 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. OSBotify commented on May 13, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #76741 - "Adapt message editing behavior based on screen size (Slack-style UX)" by @Kureev (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #76741 introduced a large-scale refactor of the message editing flow for narrow layouts. The bug is staged-only, not in production, and the fix would require non-trivial changes to the new context-driven edit state machine — reverting is the safest option.

    Assigned: @Kureev (PR author), @hungvu193, @adhorodyski, @mountiny (approving reviewers)
    Labels: DeployBlockerCash kept (Frontend bug in App). No label changes made.

    Detailed Analysis

    Evidence

    PR #76741 introduced a new Slack-style editing UX where narrow layouts (mobile/small screen) use the main bottom composer instead of inline editing. It added a substantial new context system (ComposerProvider, ComposerEditStateContext, ReportActionEditMessageContext) to manage the editing state machine.

    The bug is staging-only (version 9.3.73-0) and not present in production, confirming it was introduced by one of the PRs in the current staging deploy. The melvin-bot also identified this PR directly, and it is the only PR in the staging list that touches the message editing/composer flow.

    The repro steps specify narrow screen (Windows/Chrome narrow, or Android hybrid app), which aligns exactly with PR #76741's "narrow layout uses bottom composer" code path.

    Verification

    Files affected by the bug:

    • src/pages/inbox/report/ReportActionCompose/ComposerProvider.tsx
    • src/pages/inbox/report/ReportActionCompose/useComposerSubmit.ts
    • src/pages/inbox/report/ReportActionEditMessageContext.tsx
    • src/pages/inbox/report/ReportActionCompose/useEditComposerToggle.ts
    • src/pages/inbox/report/ReportActionCompose/ComposerSendButton.tsx

    PR #76741 created or substantially rewrote all of these files. Confirmed via gh pr view 76741 --json files.

    Root Cause

    The bug occurs specifically when editing an already-edited message on narrow layout and then clearing all text.

    In ReportActionEditMessageContext.tsx, the updateMessage() function (line 144) only updates editingMessage state when prevEditingReportActionID !== editingReportActionID. When re-editing the same message a second time, the report action ID has not changed, so editingMessage is NOT updated to the current draft — it retains the previously-submitted (already-once-edited) text.

    In ComposerProvider.tsx line 69: effectiveDraft = isEditingInComposer ? editingMessage : draftComment. Since editingMessage is stale (not empty), when submitDraftAndClearComposer runs after clearing the text, the check at line 192 (effectiveDraft !== null && effectiveDraft !== '') evaluates as true using the stale editingMessage value.

    This causes setDidResetComposerHeight(true) to be called. Since isEditingInComposer is computed as shouldUseNarrowLayout && editingState !== 'off' && !didResetComposerHeight, setting didResetComposerHeight = true flips isEditingInComposer to false. The submit path in validateAndSubmitDraft then does NOT call publishDraft (which would trigger the delete modal), instead calling addComment with an empty string (which also early-returns since it is empty). The draft is not cleared and the editing state becomes stuck — editingState remains 'editing' in the context but isEditingInComposer is now false, making the message unselectable and the composer unresponsive.

  6. 14 remaining items

  7. changed the title [-]Chat - Unable to delete edited message by removing all the content on composer.[/-] [+][Due for payment 2026-05-20] Chat - Unable to delete edited message by removing all the content on composer.[/+] on May 13, 2026
  8. melvin-bot commented on May 13, 2026

    @melvin-bot

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

  9. melvin-bot commented on May 13, 2026

    @melvin-bot

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

    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 13, 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-20] Chat - Unable to delete edited message by removing all the content on composer.[/-] [+][Due for payment 2026-05-22] [Due for payment 2026-05-20] Chat - Unable to delete edited message by removing all the content on composer.[/+] on May 15, 2026
  12. melvin-bot commented on May 15, 2026

    @melvin-bot

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

    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)
  13. melvin-bot commented on May 15, 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]

  14. melvin-bot commented on May 15, 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.

  15. lanitochka17 commented on May 15, 2026

    @lanitochka17
    Author

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

  16. melvin-bot commented on May 15, 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.

  17. melvin-bot commented on May 16, 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.

  18. melvin-bot commented on May 16, 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.

  19. jponikarchuk commented on May 16, 2026

    @jponikarchuk

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

  20. melvin-bot commented on May 16, 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.

  21. lanitochka17 commented on May 16, 2026

    @lanitochka17
    Author

    Deploy Blocker ##90891 was identified to be related to the PR ##90516 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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions