jupyterlab / jupyter-collaboration

A Jupyter Server Extension Providing Support for Y Documents
https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/
Other
140 stars 29 forks source link

Workaround for later initialization, recovers document_ttl #318

Open asteppke opened 2 weeks ago

asteppke commented 2 weeks ago

This is a short fix for https://github.com/jupyterlab/jupyter-collaboration/issues/315.

In the future this can be updated when the changed traitlets infrastructure is fully taken into account but for now this restores the document_ttl functionality and should have no negative side effects.

github-actions[bot] commented 2 weeks ago

Binder :point_left: Launch a Binder on branch asteppke/jupyter-collaboration/main

davidbrochart commented 1 week ago

Thanks @asteppke.

In the future this can be updated when the changed traitlets infrastructure is fully taken into account

What do you mean by "changed traitlets infrastructure"?

asteppke commented 1 week ago

Thanks @asteppke.

In the future this can be updated when the changed traitlets infrastructure is fully taken into account

What do you mean by "changed traitlets infrastructure"?

I did not bisect this in detail but when you implemented the document_ttl functionality in the past I think it worked as intended. Instead of going through the normal traitlets initialization code the attributes are set directly here in jupyter_collaboration (I guess because of late initialization). The traitlet guys mention in passing in their documentation that since 5.0 there is a deferral happening of the conversion from command line arguments to traits. So therefore jupyter_collaboration is now setting the 'still-unconverted-strings' as attributes instead of traits.

So this adding the missing conversion step. I can see if this can be shown also within the a test in the test suite.

asteppke commented 1 week ago

I added the corresponding tests for the document_ttl. Other unrelated tests fail though already without these commits.