Use local paths instead of driveName:path in the shared model#13866
Merged
Conversation
|
Thanks for making a pull request to jupyterlab! |
bcf7751 to
b68d5be
Compare
fcollonval
reviewed
Jan 27, 2023
Member
Author
|
@meeseeksdev please backport to 3.6.x |
meeseeksmachine
pushed a commit
to meeseeksmachine/jupyterlab
that referenced
this pull request
Mar 2, 2023
…th in the shared model
fcollonval
pushed a commit
that referenced
this pull request
Mar 6, 2023
…shared model (#14111) Co-authored-by: Carlos Herrero <contact@carloshb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JupyterLab prefixes every path with the name of the drive (like
driveName:foo/bar.txt). When we make a call to the contents manager, this one is responsible for removing the name of the drive from the path, making the request through the corresponding drive, and adding the name of the drive back to each path present in the response.To be able to rename files in a collaborative session, we added the path of the document to the shared model. At the moment, this path is used by the backend (jupyter_server_ydoc) to track whether the file was renamed or not.
Since the path is used by the backend and it doesn't know about drives, the context has the same responsibility as the contents manager (removing/adding the name of the drive into the path every time it writes/reads the path from the shared model).
References
Code changes
Transforms the path every time the context writes/reads from the shared model.
User-facing changes
Fixes a bug when restoring a document in collaborative mode
Backwards-incompatible changes
N/A
cc @fcollonval