RocketChat / RocketChat/EmbeddedChat
Critical: handleTypingEvent busy-wait blocks main thread and freezes UI during typing updates
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 165
- Forks
- 381
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
Description:
The EmbeddedChat UI can become unresponsive when typing status updates are processed frequently.
The issue is caused by a busy-wait synchronization pattern in handleTypingEvent (while (typingHandlerLock) {} with a global lock). Because JavaScript runs on a single thread, this loop blocks the event loop and prevents UI rendering, timers, and async callbacks from running during the wait period.
As typing events increase, this can freeze chat interactions for noticeable periods and severely degrade usability.
Steps to reproduce:
- Open EmbeddedChat and join a room.
- Have another user or bot repeatedly toggle typing status (start typing / stop typing) in the same room.
- Observe the UI while typing events are being emitted rapidly.
Expected behavior:
Typing status updates should be handled without blocking the main thread, and the chat UI should remain responsive throughout.
Actual behavior:
During frequent typing-status updates, the UI can freeze for up to ~2 seconds or more, and user interactions (typing, clicking, scrolling) become temporarily unresponsive.
Contributor guide
No contributing guide indexed for this repository
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
Search for handleTypingEvent and the global typingHandlerLock, then reproduce the rapid typing-status update scenario in EmbeddedChat. Trace how the current busy-wait affects the event loop and verify that typing updates no longer freeze rendering, timers, or user interactions during the reported workload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100