-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Problem
In the shared document, the messages are a YArray of messages, and each message is a simple dict.
Therefore, individual message change is not propagated to other users of the shared document, because the list did not change.
To propagate the update of one message to other users, we need to replace the whole message, which trigger a change including a removal and insertion (see ts implementation and python implementation)
All the users will be signaled that a change occurs on the list, but have no information about the change of the individual message itself.
Proposed Solution
Use YMap for each message instead of dict, then we'll be able to listen for change in individual message, and avoid modifying the whole list.
Additional context
This feature is particularly useful when using chat with LLM, which primarily streams messages and therefore updates them multiple times for a single request.
Related to #212