Skip to content
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

DOMException after selecting a folder that is a symlink to another disk, with Chromium snap on Ubuntu #283

Closed
mossroy opened this issue Aug 6, 2022 · 3 comments
Assignees
Labels
bug/non-critical upstream Should be worked on in kiwix-js
Milestone

Comments

@mossroy
Copy link

mossroy commented Aug 6, 2022

Discussion had started in kiwix/kiwix-js#656 (comment)
I was testing the File System Access API on Chromium 104 on Ubuntu 20.04 (using the snap provided by Ubuntu)
If I select my usual directory where my ZIM files are located, it displays an error in the log:

Uncaught (in promise) DOMException: A requested file or directory could not be found at the time an operation was processed.
Promise.then (async) 
  | iterateAsyncDirEntryArray | @ | app.js:2987
  | processNativeDirHandle | @ | app.js:3018
  | (anonymous) | @ | app.js:2917
  | Promise.then (async) |   |  
  | pickFolderNativeFS | @ | app.js:2914
  | (anonymous) | @ | app.js:1168

and it does not display any ZIM file.

If I move all the content in a local directory, or directly point to the other disk, it works well.
So I suspect it could come from the fact that my usual directory is in fact a symlink to a directory in another disk.

It might be not related to kiwix-js-windows code

@Jaifroid Jaifroid self-assigned this Aug 6, 2022
@Jaifroid
Copy link
Member

Jaifroid commented Aug 6, 2022

This may be a limitation of the API. I enumerate files in the directory using the API, not using any special technique. In fact, given the sandboxed nature of access to a directory under this API, it doesn't really surprise me that it would be forbidden to follow symlinks to another directory for which permission hasn't been granted.

What I suggest is that I handle it by detecting the error and giving some feedback to the user.

@Jaifroid
Copy link
Member

Jaifroid commented Aug 8, 2022

OK, I've found out that there is indeed an inconsistency in the API, and a corresponding issue in the spec, and bug report on Chromium. See:

Precisely the issue you noted, @mossroy, is mentioned in the second: "Linux: trying to open a symlink errors because the file cannot be found". I'm marking this as upstream, but it could still be useful to inform the user.

@Jaifroid
Copy link
Member

As there's really nothing I can do to fix this upstream issue, I'm closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/non-critical upstream Should be worked on in kiwix-js
Projects
None yet
Development

No branches or pull requests

2 participants