jupyterlab
jupyterlab copied to clipboard
Don't show alert when leaving window in collaborative mode
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.
Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link:
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.
Looking into the tests, the documentation test doesn't seem related. And the service test works locally (probably not related).
OK to merge?
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?
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?
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?
Closing as UI RTC integration has been factored out of core JupyterLab.