jupyterlab / jupyter-collaboration

A Jupyter Server Extension Providing Support for Y Documents

Home Page:https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collaboration not working inside file but works in terminal.

vanyle opened this issue · comments

Description

While I can see cursors and selections of other people, the file is not saved automatically and I cannot see what other users are typing. I does not work for notebooks or plain text files.
When using a terminal however, collaboration works properly.

image

Reproduce

I'm using the following docker-compose.yml file:

services:
  jupyter:
    image:  jupyter/pyspark-notebook:latest
    restart: unless-stopped
    ports:
      - "8888:8888"
    user: root
    working_dir: /home/vanyle
    environment:
      - NB_USER=vanyle
      - CHOWN_HOME=yes
    command: "start-notebook.py --ServerApp.token='' --ServerApp.password=''"
    volumes:
      - ./models:/home/vanyle/work

When the docker is started, I manually install jupyter_collaboration and I restart the docker.

Expected behavior

I would expect jupyter-collaboration to work. When a character is typed on one device, it appears on the other.

Context

  • Operating System: The issue occurs on all OS I tested, including Windows 11 and MacOS (meaning the docker is executed inside MacOS / inside Windows).
  • Browser and version: The issue arises on all browser I tested, including Firefox, Edge and Chrome.
  • JupyterLab version: 4.1.4
  • Jupyter collaboration version: 2.0.3

I have the following plugins installed:

image

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

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! 👋

Welcome to the Jupyter community! 🎉

What do you mean by "works in terminal"?

I'm facing the issue, it seems to be caused by pycrdt v0.8.13.
Could you pip install "pycrdt<0.8.13" and see if it solves your issue?
I'll investigate what is wrong in pycrdt.

I yanked pycrdt v0.8.13 on PyPI, marked it as broken on conda-forge, and released v0.8.15 with a fix.

It works! Thank you! I spend like 2 hours tweaking the configuration of my docker (as I'm using a custom docker with a lot of extensions) and nothing was working.

Just out of curiosity, what was the issue with pycrdt ?

In pycrdt v0.8.13 the Rust backend Yrs was updated to v0.18, which changed the way observer subscriptions are handled. Now instead of getting a subscription ID, a subscription object is returned, and unobserving is done by dropping the object, so in Python a reference to the subscription has to be kept, otherwise it gets garbage-collected and it is dropped on the Rust side (see y-crdt/y-crdt#398).
I had done that for shared types in jupyter-server/pycrdt#85 but I forgot to do it for docs, and that's now fixed in jupyter-server/pycrdt#87.
Basically all this means is that the changes to a document in JupterLab was not propagated to other users.