WICG / file-system-access

Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications.
https://wicg.github.io/file-system-access/
Other
669 stars 66 forks source link

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

Closed isiah-lloyd closed 2 years ago

isiah-lloyd commented 2 years ago

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.
isiah-lloyd commented 2 years ago

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

a-sully commented 2 years ago

Closed in favor of https://github.com/WICG/file-system-access/issues/313