Cancelling More -> Edit loses unsent composer draft (and ArrowUp edits resurrect old drafts)

Aperta
#44,043 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Arnav-0206 ci sta già lavorando.

Dal 30/11/2026.

  • #44045 di @Arnav-0206 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

The issue describes draft state being lost or restored incorrectly during message editing, but names no source files or tests. Start by tracing the composer draft state and the edit and cancel flows, including the ArrowUp path, then find the related tests. Done means cancelling an edit restores the current unsent draft and never resurrects an older draft; an open linked pull request (#44045) already addresses this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: bug
Description:

When you have unsent text in the composer, clicking More -> Edit on an earlier message and then clicking Cancel (or pressing Escape) clears the composer and loses your draft.

In addition, editing a message via ArrowUp caches the unsent draft in ChatMessages.data and never clears it when editing ends, so a later More -> Edit -> Cancel brings back that old draft even after it was deleted or replaced with new text.

Steps to reproduce:

Case 1 (draft lost):

  1. Open a room with an existing message from your user and type SOME TEXT in the composer (do not send).
  2. Open the message menu on that message and click Edit.
  3. Click Cancel (or press Escape).

Case 2 (old draft resurrected):

  1. Type ANOTHER TEXT in the composer and edit the previous message using ArrowUp.
  2. Press Escape to cancel, then delete ANOTHER TEXT (or replace it with new text).
  3. Click More -> Edit on any message, then click Cancel.
Expected behavior:
  • Case 1 restores SOME TEXT in the composer, matching ArrowUp.
  • Case 2 either stays empty (if cleared) or restores the current draft, rather than bringing back ANOTHER TEXT.
Actual behavior:
  • Case 1: SOME TEXT is lost and the composer becomes empty.

https://github.com/user-attachments/assets/0723789d-d2b4-4910-9b5f-8815c4b6643d

  • Case 2: ANOTHER TEXT reappears in the composer even after being cleared or replaced.

https://github.com/user-attachments/assets/def04a69-3cdf-41bc-b699-4e3ac45bbf73

Server Setup Information:
  • Version of Rocket.Chat Server: 9.2.0-develop
  • License Type: Community
  • Number of Users: 1
  • Operating System: Ubuntu (WSL 2)
  • Deployment Method: Local development (yarn dsv)
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: v24.15.0
  • MongoDB Version: 8.0
Client Setup Information
  • Desktop App or Browser Version: Brave (Chromium)
  • Operating System: Windows
Additional context

Discovered on current develop while testing composer draft handling alongside message edits.

Relevant logs:

No errors in server or browser console; client-side edit draft state issue.

Lingua principale
TypeScript
Stelle
46.6k
Fork
14.2k
Merge medio
2g 21h
PR unite (30g)
302

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/Rocket.Chat

Tutte le issue di RocketChat/Rocket.Chat

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.