-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with directories #37
Comments
Update for
|
If the empty folder is created using the AWS console and I try to open this empty folder I'm still facing an error. I get 502 Bad Gateway api response and the following error is logged in. If I restart the Jupyter Lab then I am able to open this empty folder again, however looking from AWS Console in this S3 bucket this folder is still empty, there is no
|
Apparently this error only happens if the empty folder is on the root level inside the S3 bucket, if the empty folder is inside another folder then this issue doesn't happen |
Problem description
The backend contents manager uses the
obstore
package to list the contents given a path inside a drive, retrieve the contents of an object and for all other functionalities to manipulate content (create, save, rename, copy, delete, download).Unfortunately, the package does not include the concept of a directory. As such, when listing the contents given a path, it is impossible to differentiate between an empty directory or an empty file.
It is important to note that even if the
S3
provider doesn't have a typical directory, they create a zero-length object with a key ending in/
to mimic one (see red box marked important here).The
obstore
package removes these trailing slashes when dealing with the key to an object, so it is impossible to properly interact with a directory. For example, when creating a directory, it actually creates a broken file, and only once you put other objects into that supposed directory, it creates it, but you are still left with the initial broken file.As such, it becomes problematic to:
DriveBrowser
(the zero-length object itself, not the objects inside of it)Current state of extension
v0.0.1
The current logic to identify directories is based on the name not including
.
, as files which have extensions do (.txt
,.ipynb
, etc). If they do include a.
, we check if the string after the character is not one of the registered file extensions inJupyterLab
, and then consider it a directory.The logic is faulty as directories can include the
.
character in whatever format. It also does not solve the issue of interacting with already created directories, which contain the trailing slash.Possible solution
Use another package for the backend content manager to perform content manipulation operations, but keep the
obstore
package for its paginated listing abilities.The text was updated successfully, but these errors were encountered: