I'm using the Google Drive API (v3) to download and display metadata for all files in a user's drive. Recently I have discovered a problem for some users, where some files are not returned by the list() method
Listing of all files is done by the following (simplified) Python code
result = self.get_service().files().list().execute()
file_list = result["files"]
while "nextPageToken" in result:
result = self.get_service().files().list(pageToken=result["nextPageToken"]).execute()
file_list = file_list + result["files"]
For example, one user has a folder "H", which should contain a certain number of files, as seen in the stock Drive web app. After processing the list, I do find an entry corresponding to "H", but no entries that have the id of "H" in their parents array.
The permission scope used by the app is full access: "https://www.googleapis.com/auth/drive"
(I've seen some similar questions here and on Google's product forums, but nothing that was more recent than 2014.)
Am I missing something?
EDIT: Request includes trashed files - we can see the 'trashed=True' parameter in other results. I also know it's not a pagination issue - the nextPageToken value is always present when expected, and I have seen the output of file_list having a length longer than 1000 - the maximum page size