jupyter-server / jupyter_ydoc

Jupyter document structures for collaborative editing using Yjs/pycrdt
https://jupyter-ydoc.readthedocs.io
BSD 3-Clause "New" or "Revised" License
28 stars 17 forks source link

y-py v0.5.5 from conda-forge breaks ydoc #143

Closed hbcarlos closed 1 year ago

hbcarlos commented 1 year ago

Due to the problem with the y-py aarch64 build (here: https://github.com/y-crdt/ypy/pull/119). We published a new build of ypy v0.5.5 in conda-forge. This new build includes https://github.com/y-crdt/ypy/pull/102, which changes the return type of the to_json and breaks jupyter_ydoc.

Task exception was never retrieved
future: <Task finished name='Task-175' coro=<YDocWebSocketHandler.maybe_save_document() done, defined at /Users/carlos/Documents/qs/rtc_dev/jupyterlab_collaboration/jupyter_collaboration/handlers.py:342> exception=TypeError('string indices must be integers')>
Traceback (most recent call last):
  File "/Users/carlos/Documents/qs/rtc_dev/jupyterlab_collaboration/jupyter_collaboration/handlers.py", line 365, in maybe_save_document
    if model["content"] != self.room.document.source:
  File "/Users/carlos/Documents/qs/rtc_dev/jupyter_ydoc/jupyter_ydoc/ybasedoc.py", line 60, in source
    return self.get()
  File "/Users/carlos/Documents/qs/rtc_dev/jupyter_ydoc/jupyter_ydoc/ynotebook.py", line 215, in get
    if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
TypeError: string indices must be integers

The error above is caused by https://github.com/jupyter-server/jupyter_ydoc/blob/c9db1e72b477e8400467d35b14d1df19d581d707/jupyter_ydoc/ynotebook.py#L194, because when installing y-py v0.5.5 from conda-forge, the to_json method returns a string.

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

davidbrochart commented 1 year ago

We published a new build of ypy v0.5.5 in conda-forge. This new build includes y-crdt/ypy#102

I think that's the issue, the conda-forge package for v0.5.5 should not include this PR, since it was not released yet.

davidbrochart commented 1 year ago

Ah I see, it was partly released in v0.5.5, which now have inconsistent wheels (aarch64 wheels have https://github.com/y-crdt/ypy/pull/102 while others don't). We should have bumped the version.