Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using real time collaboration with Jupytext #1124

Open
asteppke opened this issue Sep 4, 2023 · 7 comments
Open

Using real time collaboration with Jupytext #1124

asteppke opened this issue Sep 4, 2023 · 7 comments

Comments

@asteppke
Copy link

asteppke commented Sep 4, 2023

When using Jupytext with Jupyterlab 4 and the real time collaboration feature and using a notebook in the %-format, e.g. test.py the collaboration does not work straight away.

The issue is that when creating the link to share the notebook, for example "localhost:8888/lab/.../RTC%3A.../test.py" the second jupyter lab browser instance thinks this is a pure .py file and opens the plain text editor. And collaboration between the notebook editor and the plain text editor is not supported (jupyterlab/jupyter-collaboration#189).

As a workaround one can always make sure only create links to the .ipynb file. Is there a possibility that this works with notebooks as %-formatted .py files as well?

@parmentelat
Copy link
Contributor

out of curiosity could you please try to run this in a terminal

jupytext-config set-default-viewer

before trying again (not quite sure what exactly needs to be restarted, so please be on a safe side and restart the jupyter lab session entirely)

@asteppke
Copy link
Author

Thanks @parmentelat for the comment. I tried the command, reset the workspace, restarted jupyter lab and that worked out nicely! So this part of the the issue looks solved.

What turns out now is even more severe though...

To reproduce on Jupyter lab 4.0.6 with jupytext 1.15.2 and collaborative extension 1.2.0 data loss occurs with the following steps here:

  1. Create a test notebook with the content
print('test')
  1. Pair this with jupytext to a corresponding percent-file.
  2. Close and shutdown the kernel.
  3. Open the .py file and execute the first cell.
  4. Close and shutdown the kernel.
  5. Open the original .ipynb.

The file content is now looks corrupted:
image

The file content on disk looks OK though.

@parmentelat
Copy link
Contributor

hi @asteppke

  • I am a little confused, to clarify, you wrote twice the words 'the file content', in both instances you are referring to the ipynb, not the py file, right ?
  • my understanding is that at this stage the issue no longer relates to rtc (real time collab), can you please confirm that ?
  • in other words, does it still happen if you turn off the collaboration extension ?
  • finally if the issue vanishes when you turn off the collaboration extension, I would tend to think the issue belongs in that extension and not in jupytext, does that make sense ?

@asteppke
Copy link
Author

Hi @parmentelat,
Sorry if I did not explain this well enough. With file content I mean indeed the .ipynb file, at least as it is shown in the Jupyter lab interface (see screenshot). The on-disk content looks at first glance OK.

Without the collaboration extension this bug does not occur. It requires both, jupytext and the collaboration extension to happen. So it is most likely an interaction of both extensions, I cannot judge in which code part the responsibility for this lies.

@goerz
Copy link

goerz commented Nov 13, 2023

I'm seeing the exact same bug as described in #1124 (comment) (paired with the "light" script). The jupytext and jupyter-collaboration appear to be mutually incompatible.

I've opened jupyterlab/jupyter-collaboration#214

@mwouts
Copy link
Owner

mwouts commented Nov 14, 2023

Thank you @asteppke for reporting this, and @goerz for the confirmation and cross report. I have not had a chance yet to give a try to the collaboration extension, but I will at least subscribe to the corresponding issue report.

@goerz
Copy link

goerz commented Dec 15, 2023

The issue is still there with the newest jupyter-collaboration 2.0 release: jupyterlab/jupyter-collaboration#214 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants