jupyterlab icon indicating copy to clipboard operation
jupyterlab copied to clipboard

Don't show alert when leaving window in collaborative mode

Open davidbrochart opened this issue 3 years ago • 5 comments
trafficstars

Code changes

When in collaborative mode, it doesn't make sense to ask the user to confirm that they want to leave the page if the document is dirty in collaborative mode, because the document is auto-saved anyway from the back-end (if the server is not stopped in the next second after the last change). However, I can see that after the page is reloaded, the document is left in a wrong state, e.g. the kernel doesn't appear to be running even though it was running previously, the cell output doesn't show the stream, etc. But this looks like an independent problem that should be fixed in another PR.

User-facing changes

No alert box when leaving page in collaborative mode.

Backwards-incompatible changes

None.

davidbrochart avatar Jun 10 '22 14:06 davidbrochart

Thanks for making a pull request to jupyterlab! To try out this branch on binder, follow this link: Binder

jupyterlab-probot[bot] avatar Jun 10 '22 14:06 jupyterlab-probot[bot]

Hi @davidbrochart, good catch! Thanks for opening this PR. LGTM.

However, I can see that after the page is reloaded, the document is left in a wrong state, e.g. the kernel doesn't appear to be running even though it was running previously, the cell output doesn't show the stream, etc. But this looks like an independent problem that should be fixed in another PR.

Yes, we should look at this in another PR. Anyway, I can not reproduce it. When I reload the page, the kernel is running and the cell output is there.

hbcarlos avatar Jun 22 '22 09:06 hbcarlos

Looking into the tests, the documentation test doesn't seem related. And the service test works locally (probably not related).

hbcarlos avatar Jun 22 '22 10:06 hbcarlos

OK to merge?

davidbrochart avatar Jul 20 '22 10:07 davidbrochart

I think we could auto-save also when all clients disconnect, not just after a document change. This way, there would still be no need for the user to press the save button. We could also auto-save all documents at server exit. What do you think?

davidbrochart avatar Jul 25 '22 09:07 davidbrochart

Wouldn't we want to keep the dialog to cover cases when the frontend changes are not fully sync'd with the backend? But maybe that is a different dialog?

ellisonbg avatar Oct 11 '22 01:10 ellisonbg

By "not fully sync'd with the backend", do you mean "saved"? If yes, the document will probably already be saved by the time the user interacts with the dialog. I don't know if it's possible or even desirable to close the dialog when the dirty flag is cleared again?

If by "not fully sync'd with the backend" you mean that the Y update didn't arrive yet in the backend, it seems to be hard for the frontend to have this information. Or am I missing something?

davidbrochart avatar Oct 11 '22 07:10 davidbrochart

Closing as UI RTC integration has been factored out of core JupyterLab.

fcollonval avatar Mar 13 '23 08:03 fcollonval