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'?