Some data will be lost after Google Drive API Re-authorize

Viewed 52

Some data will be lost after Google Drive API Re-authorization (drive.files.list)

My steps

  1. Create 4 folders using API
drive.files.list
[
   {id:'XXXX1', name:'folder1'},
   {id:'XXXX2', name:'folder2'},
   {id:'XXXX3', name:'folder3'},
   {id:'XXXX4', name:'folder4'},
]
  1. Cancel authorization ([disconnect from drive] in Google Drive App) enter image description here

  2. Re-authorize and then call the api

drive.files.list
[
   {id:'XXXX2', name:'folder2'},
   {id:'XXXX3', name:'folder3'},
]

I can no longer get a complete list, but if I specify a file id can return the contents of the file

drive.files.get({fileId:'XXXX1' })
{id:'XXX1', name:'file1'}

I use scope as https://www.googleapis.com/auth/drive.file

Does anyone know how to make it work?

1 Answers

https://www.googleapis.com/auth/drive.file Per-file access to files created or opened by the app. File authorization is granted on a per-user basis and is revoked when the user deauthorizes the app.

Drive.file is used to access files created by your app. So that you shouldn't have access to the users full drive account just the files and directories you create.

When you disconnect access to the app and then reconnect it I personally would expect everything to be gone.

I would post this over on the issue tracker it seams strange to me that only some of the data remains it should either all be there or all be gone.

https://issuetracker.google.com/issues?q=componentid:191650%2B

Related