You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The collab plugin changes the autosave functionality to save files in a different route to normal jupyterlab file saves. This is not an issue without the collab plugin if manually saving or saving with the default autosave functionality.
When files have DOS line endings, any text entered is saved shifted to the left.
This is apparent if the file is closed and re-opened, as it appears fine in the editor but is saved incorrectly to disk.
The longer the file, the more shifted to the left, which makes it appear that the information sent through the websocket is ignoring the extra carriage return char, so when applying the changes to the file it does not take that into account, hence everything is shifted to the left.
Example of the same change being applied to 2 files, one with dos line endings and one with normal linux line endings:
==> example-dos.py <==
import os
import sys
nameKuba = ""
print(f"Hello {name}")
==> example-unix.py <==
import os
import sys
name = "Kuba"
print(f"Hello {name}")
Reproduce
See this PR with a failing test for DOS line endings with a carriage return and passing for Linux line endings without the carriage return: #449
Edits to files with DOS line endings should be correctly saved.
Context
Reproduced on multiple systems, first found in AWS sagemaker, but reproduced on vanilla jupyter and then got a failing test in the ui tests of this repo.
This does not happen when using jupyterlab's default save or autosave functionality.
The text was updated successfully, but these errors were encountered:
Description
The collab plugin changes the autosave functionality to save files in a different route to normal jupyterlab file saves. This is not an issue without the collab plugin if manually saving or saving with the default autosave functionality.
When files have DOS line endings, any text entered is saved shifted to the left.
This is apparent if the file is closed and re-opened, as it appears fine in the editor but is saved incorrectly to disk.
The longer the file, the more shifted to the left, which makes it appear that the information sent through the websocket is ignoring the extra carriage return char, so when applying the changes to the file it does not take that into account, hence everything is shifted to the left.
Example of the same change being applied to 2 files, one with dos line endings and one with normal linux line endings:
Reproduce
See this PR with a failing test for DOS line endings with a carriage return and passing for Linux line endings without the carriage return: #449
Also see this notebook: https://github.com/BaukJ/work-snippets/blob/main/2025/03/sagemaker-dos-bug/DosBugNotebook.ipynb
And this video of the failing test, taken directly from the UI tests:
https://github.com/user-attachments/assets/49b539de-e857-451d-8816-58e00223c263
Expected behavior
Edits to files with DOS line endings should be correctly saved.
Context
Reproduced on multiple systems, first found in AWS sagemaker, but reproduced on vanilla jupyter and then got a failing test in the ui tests of this repo.
This does not happen when using jupyterlab's default save or autosave functionality.
The text was updated successfully, but these errors were encountered: