RocketChat / RocketChat/Rocket.Chat
Race condition when editing message
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:
- Write a message.
- Switch to edit mode for this message. Modify the text.
- Submit the modified message text.
- 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
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
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