Description
document_ttl compares the time elapsed since the previous update was sent, thus often preventing squashing the updates for more active notebooks for a long time.
Reproduce
- Install ipylab
- Run
jupyter lab --SQLiteYStore.document_ttl=1
- Create a notebook with one cell:
from ipylab import JupyterFrontEnd
from time import sleep
app = JupyterFrontEnd()
for i in range(1000):
app.commands.execute('notebook:insert-cell-below')
sleep(0.1)
app.commands.execute('notebook:delete-cell')
sleep(0.1)
- See that condition
diff > self.document_ttl is never true, thus the squashing logic never gets executed:
https://github.com/jupyter-server/pycrdt-websocket/blob/3a5648dc937baca71eb9e997a6aaf8e3d6c91654/pycrdt_websocket/ystore.py#L489
Expected behavior
We have a way to prevent SQL store from blowing to dangerous sizes, even if user continues to edit it. For example, if we set --SQLiteYStore.document_ttl=60 we expect to be able to have no more than 1 minute buffer in the history.
Context
pycrdt 0.12.11
pycrdt-websocket 0.15.4
jupyterlab 4.4.0
jupyter-collaboration 4.0.0
Description
document_ttlcompares the time elapsed since the previous update was sent, thus often preventing squashing the updates for more active notebooks for a long time.Reproduce
jupyter lab --SQLiteYStore.document_ttl=1diff > self.document_ttlis never true, thus the squashing logic never gets executed:https://github.com/jupyter-server/pycrdt-websocket/blob/3a5648dc937baca71eb9e997a6aaf8e3d6c91654/pycrdt_websocket/ystore.py#L489
Expected behavior
We have a way to prevent SQL store from blowing to dangerous sizes, even if user continues to edit it. For example, if we set
--SQLiteYStore.document_ttl=60we expect to be able to have no more than 1 minute buffer in the history.Context