From 1bfd0d34156fda66e2c1a4f3af9083600139eddd Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Mon, 16 Dec 2024 22:46:11 +0100 Subject: [PATCH] Do not update the time when a message is streaming --- python/jupyterlab-chat/jupyterlab_chat/ychat.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/jupyterlab-chat/jupyterlab_chat/ychat.py b/python/jupyterlab-chat/jupyterlab_chat/ychat.py index dd56072..6f14f68 100644 --- a/python/jupyterlab-chat/jupyterlab_chat/ychat.py +++ b/python/jupyterlab-chat/jupyterlab_chat/ychat.py @@ -160,6 +160,7 @@ def update_message(self, message: Message, append: bool = False): with self._ydoc.transaction(): index = self._indexes_by_id[message.id] initial_message = self._get_message_by_index(index) + message.time = initial_message["time"] if append: message.body = initial_message["body"] + message.body self._ymessages[index] = asdict(message, dict_factory=message_asdict_factory)