I have a bit os a mystery here and could use some insight. My public Add-on has been using the full /drive scope for years. Per Google's guidance, I'm going to switch it soon to use the /drive.file scope instead. I already use the Drive File Picker, so in theory this shouldn't cause any access issues. Except... several years back when I copied the Drive File Picker sample code from Google, the sample didn't have the .setAppId() call in it. Ergo neither does mine.
But unexpectedly, everything still seems to work. Like when I change the dev version of my Add-on to use only /drive.file, it is still able to access files previously selected with the picker. And as expected, if I try to access a file that hasn't yet been selected, it can't open it (gets an error) until I select it with the picker, after which my Add-on can open it.
I suspect that it is working because of this: the token I am passing to the picker (via setOAuthToken() ) is the token from my Add-on itself (obtained from Apps Script's ScriptApp.getOAuthToken() ). Ergo perhaps the picker is extracting certain data from that token (like OAuth client id, or even the app id) and writing it to the file's metadata to ensure future access.
But even though everything seems good, I am still worried that when I switch my production Add-on to use /drive.file, things might break for existing users who have been selecting files for the past few years.
Has anyone seen or had a similar issue, or hav any thoughts about this?