-
Notifications
You must be signed in to change notification settings - Fork 340
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.