aws / aws/sagemaker-distribution
Unable to disable autosave in jupyterlab, workspace file contents erased
- Dominant language
- Shell
- Stars
- 154
- Forks
- 120
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 27
Description
### Category
Usability Issue
### 🐛 Describe the bug
I recently updated a jupyterlab space from Sagemaker Distribution 3.x to 4.2.2. The space previously had autosave disabled, which worked correctly. This updated space also still has the same setting applied:
But the autosave still happens immediately (ignoring the large autosave interval setting as well). Likewise, there is a toggle in the settings menu that has an "Autosave Documents" option checked, and clicking that toggle has no effect:
After opening jupyterlab today with a prior workspace, it showed that the contents of all files that were opened in that workspace had been deleted and automatically saved (without being able to undo with ctrl-z). Meaning, multiple files were completely erased and autosaved. Luckily I had everything version controlled and could revert the erasure; but if that weren't the case, this bug could have been catastrophic.
Note that I had already been working in the 4.2.2 image for a few days, so the file erasure isn't a bug related directly to the transition from 3.x to 4.2.2 (though autosave itself has been permanently enabled since the update).
### 🐛 Describe the expected behavior
- Autosave respects the Document Manager setting configuration
- Autosave can be disabled via the "Autosave Documents" toggle
- Re-using a previous workspace does not delete contents of open files
### Image Tags
Sagemaker Distribution 4.2.2 with unmodified jupyterlab and extension versions:
```
JupyterLab v4.5.9
/opt/conda/share/jupyter/labextensions
catboost-widget v1.2.7 enabled OK
jupyterlab-chat-extension v0.22.1 enabled OK (python, jupyterlab_chat)
jupyterlab-commands-toolkit v0.1.6 enabled OK (python, jupyterlab_commands_toolkit)
jupyterlab-eventlistener-extension v0.4.0 enabled OK (python, jupyterlab_eventlistener)
jupyterlab-notebook-awareness v0.1.0 enabled OK (python, jupyterlab_notebook_awareness)
jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
nbdime-jupyterlab v3.0.4 enabled OK
@amzn/amazon_sagemaker_sql_editor v0.2.5 enabled OK (python, amazon_sagemaker_sql_editor)
@amzn/amzn_sagemaker_aiops_jupyterlab_extension v1.0.6 enabled OK (python, amzn_sagemaker_aiops_jupyterlab_extension)
@amzn/sagemaker-jupyter-scheduler v3.2.2 enabled OK
@amzn/sagemaker-jupyterlab-emr-extension v0.4.3 enabled X (python, sagemaker_jupyterlab_emr_extension)
@amzn/sagemaker-jupyterlab-extension-common v0.4.5 enabled OK (python, sagemaker_jupyterlab_extension_common)
@amzn/sagemaker-jupyterlab-extensions v0.5.9 enabled OK (python, sagemaker_jupyterlab_extension)
@amzn/sagemaker_gen_ai_jupyterlab_extension v1.0.11 enabled OK
@jupyter/collaboration-extension v4.4.1 disabled OK 🔒 (all plugins locked) (python, jupyter-collaboration-ui)
@jupyter/docprovider-extension v4.4.1 disabled OK (python, jupyter-docprovider)
@jupyter-ai/acp-client v0.1.5 enabled OK (python, jupyter_ai_acp_client)
@jupyter-ai/chat-commands v0.0.4 enabled OK (python, jupyter_ai_chat_commands)
@jupyter-ai/persona-manager v0.0.11 enabled OK (python, jupyter_ai_persona_manager)
@jupyter-ai/router v0.0.5 enabled OK (python, jupyter_ai_router)
@jupyter-ai-contrib/server-documents v0.2.5 enabled OK (python, jupyter_server_documents)
@jupyter-lsp/jupyterlab-lsp v5.0.3 enabled OK (python, jupyterlab-lsp)
@jupyter-notebook/lab-extension v7.5.7 enabled OK
@jupyter-widgets/jupyterlab-manager v5.0.15 enabled OK (python, jupyterlab_widgets)
@jupyterhub/jupyter-server-proxy v4.5.0 enabled OK
@jupyterlab/git v0.53.0 enabled OK (python, jupyterlab-git-core)
@jupyterlab/scheduler v2.12.0 enabled OK
```
Note that the jupyterlab collaboration-extension is disabled, and so this appears to be unrelated to the historical autosave bug reported here: https://github.com/jupyterlab/jupyterlab/issues/17735
Contributor guide
Research direction
Start at the Document Manager autosave setting and the Settings menu's "Autosave Documents" toggle in JupyterLab 4.5.9, reproducing the behavior with a reused workspace. Compare the listed extensions while isolating the autosave and workspace behavior; done means disabling autosave works and reopening a workspace never erases open file contents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter, python
- Domain
- developer-experience, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100