RocketChat / RocketChat/Rocket.Chat
Editing Mode Lost When Canceling an Empty Message Edit
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
When editing a message, if the user clears the message text entirely and then presses the Send button (or Enter key), a confirmation modal appears asking if they want to delete the message. If the user selects Cancel to prevent deletion, the composer incorrectly exits editing mode while restoring the previous message text. As a result, sending the restored text creates a new message instead of updating the original one.
This issue occurs only when the edited message is completely removed before pressing Send, leading to unintended message duplication and disrupting the expected editing workflow.
Steps to Reproduce:
- (Optional) Send a new message to any chatroom.
- Click Edit Message on an existing message.
- Clear the message text entirely.
- Press Send (Enter key) or click the send button.
- A warning modal appears with the message:
"Are you sure? You will not be able to recover this message!"
- Click Cancel to prevent accidental deletion.
Expected behavior:
When canceling an empty message edit, the Composer should remain in editing mode, and the message should either be restored to its previous content or left as an empty draft, allowing the user to continue editing without disruption.
Actual behavior:
After canceling an empty message edit, the Composer restores the previous message text but exits editing mode. Sending the restored text creates a new message instead of updating the original one.
Server Setup Information:
- Version of Rocket.Chat Server: 7.5.0-develop
- License Type: Starter
- Number of Users: 1
- Operating System: Ubuntu 22.04.5 LTS (WSL 2) (64-bit)
- Deployment Method:
yarn dsv - Number of Running Instances: 1
- DB Replicaset Oplog: 8 MB
- NodeJS Version: 22.13.1
- MongoDB Version: 7.0.5
Client Setup Information
- Desktop App or Browser Version: Microsoft Edge 134.0.3124.83 (Chromium 134.0.6998.118) (64-bit)
- Operating System: Windows 11 Version 23H2 (Build 22631.4890)
Pull Requests
35653
35655
35656: Optimal and Minimal
Additional context
https://github.com/user-attachments/assets/5109b77f-11b1-4dba-bf2b-20b3e629f892
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the empty-message edit flow and inspect the composer and confirmation-modal handling used when Cancel is selected. Compare the behavior with pull requests 35653, 35655, and 35656; done means canceling deletion keeps the composer in editing mode so a subsequent send updates the original message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100