RocketChat / RocketChat/Rocket.Chat

bug: Forwarded message attachment persists when message text is cleared during edit

Open
#39,786 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When a message is forwarded to a channel and then edited with all content removed, pressing enter has no effect. Also the forwarded message attachment persists even though text content is empty.

Steps to reproduce:
  1. Forward any message to a channel
  2. Click edit on the forwarded message
  3. Editor shows raw markdown:
  4. Delete all text completely until editor is empty
  5. Press enter or click send
Expected behavior:

The message should update successfully. Either the attachment should be removed, or the editor should handle empty text and existing attachment.

Actual behavior:

Nothing happens. Edit mode exits and the forwarded message remains completely unchanged.

Server Setup Information:
  • Version of Rocket.Chat Server: latest develop branch
  • License Type: community
  • Number of Users: 1
  • Operating System: Ubuntu (WSL)
  • Deployment Method: Source (local development)
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 22.16.0
  • MongoDB Version: 6.0.x
Client Setup Information
  • Desktop App or Browser Version: Chrome latest
  • Operating System: Windows 11
Additional context

If the forwarded message is edited again with new content, the edit works correctly and forward attachment disappears. Therefore, the issue only occurs when the text is completely empty.

Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the forwarding and edit flow in Chrome using the editor steps described in the issue, then trace how an empty edited message is submitted. Verify the behavior when all text is removed and confirm that the message updates with the forwarded attachment removed or that empty text with an existing attachment is handled consistently.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.