-
Notifications
You must be signed in to change notification settings - Fork 66
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
queryPermission()
shouldn't return "prompt" when a handle retrieved from idb no longer exists on drive
#313
Comments
this is useful but i do thing that a developer might show a message saying something in terms of "you have dined us from trying to read the folder xyz, try again?" |
Currently |
The API's permissioning model is mostly indifferent to what's actually happening on disk, in part because the underlying file system can change at any time. I'd be hesitant to provide any information about the state of the file (such as whatwg/fs#30 attempts to address this by being explicit that a FileSystemHandle simply maps to a path. If the path no longer exists (for example, the handle has been Change events, proposed in #72, will hopefully soon fill the gap here by notifying the site when the underlying file system changes |
I think "missing" could be fitted for other things as well like you could for instance only have a usb-webcam and if you unplug it then you no longer have it. |
Any changes to |
In my app, the user grants permission to a folder, then I store the handle in idb. On the next launch, I retrieve the handle and call
requestPermission()
to ask for permission again.Goal:
I want to avoid showing the folder picker window. Since the folder location probably didn't change, showing the folder picker is an unnecessary step, and negatively affects user experience if the user don't remember to previous location they used.
Problem:
If the folder has been deleted / renamed / moved, the page will still prompt for permission to the old location. If the user clicks "agree", the subsequent read / write will fail, only then will I know the folder is gone, and show a picker again. This is confusing to the user.
Solution:
After a handle is retrieved from idb, there should be a way to test if it still exists on drive, and browser should be able to test that without requiring user permission. If the old location is still there, then I can request user permission. If the the old location is gone, I'll display a picker.
(This may open doors to certain ways of abuse, but we can devise some restrictions)
Proposal
If the handle no longer exist on drive, maybe let
queryPermission()
return'denied'
?The text was updated successfully, but these errors were encountered: