WICG / file-system-access

Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications.

Home Page:https://wicg.github.io/file-system-access/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling queryPermission() should raise an error if it's called on a handle that has been moved or deleted

isiah-lloyd opened this issue · comments

Currently, if an application calls queryPermission() on a moved or deleted folder or file it still returns prompt. I propose that this should be changed because it currently hinders user experience and may cause confusion.

Example Bad UX

  1. User has already given permission to a folder to app and is returning to app. App's use case makes heavy use of the file system access API and the user will be expecting to use that folder right away
  2. The website opens a modal and asks the user to accept permission to access the folder and presents a button (because calling promptPermission() can't be called without a user gesture)
  3. The user clicks the button and now the browser presents a modal to the user asking them if they wish to grant access.
  4. The application now tries to iterate through the folder using .values(). A DOMException is raised DOMException: A requested file or directory could not be found at the time an operation was processed..
  5. The user is confused and/or frustrated that the folder they just went through 2 permission modals now suddenly has an error.

I now see this issue has also been raised in #313

Closed in favor of #313