RocketChat / RocketChat/Rocket.Chat

Race condition when editing message

Open
#30,790 4 comments 1 reaction 0 assignees View on GitHub

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 quickly submitting a new message after editing an existing one, no new message will be saved. Instead, the message that has just been edited will be overwritten.

Steps to reproduce:
  1. Write a message.
  2. Switch to edit mode for this message. Modify the text.
  3. Submit the modified message text.
  4. In the short time window before the change to the message has been persisted, submit a new message.

The time window for step 4 is usually quite short. It becomes longer if the server is under load or the network is slow.

Expected behavior:

There are two messages: One contains the text from step 3 and one contains the text from step 4.

Actual behavior:

If you executed step 4 fast enough, there will only be one message. It contains the text from step 4. It is marked as being edited.

Additionally, the error message "Cannot read properties of undefined (reading 'stop')" is shown.

https://github.com/RocketChat/Rocket.Chat/assets/404840/c868a20e-5d68-49ff-9fe1-3631a64037a1

Server Setup Information:
  • Version of Rocket.Chat Server: 6.4.4
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • MongoDB Version: 6.0.11
Client Setup Information
  • Browser Version: Chromium Version 118.0.5993.117 (Offizieller Build) Arch Linux (64-Bit)
  • Operating System: Arch Linux

At least one user reported that they were able to reproduce this problem on Firefox.

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

No source files, tests, or entry points are named in the issue. Start by reproducing the edit-then-send sequence with delayed persistence, then trace the client-side message editing and sending flow. Done means both messages are saved independently, the edited message remains marked correctly, and the undefined “stop” error no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.