0

I have a folder with 18 files. If I do a list with maxResults=20, I get all 18. So far so good.

If I set maxResults=10, I get 10 and a...

 "nextPageToken": "!!|~EAIaggELEgA6egpi96NuFMj_____f_8AAP__AAD_KFSjepDGzcnNxs3GzMnPy8jRyNGqpsyrlMusoLmnlP8AAP__AP7__n__AP8AKFSjepDGzcnNxs3GzMnPy8jRyNGqpsyrlMusoLmnlP8A__4QESF03OHBi8LW0zkAAAAAN-uRXEgBDEAAIgsJb4Vcq9cAAAAgBg"

... so far so good.

If I then request another 10 using the pageToken

https://www.googleapis.com/drive/v2/files?pageToken=!!%7C~EAIaggELEgA6egpi96NuFMj_____f_8AAP__AAD_KFSjepDGzcnNxs3GzMnPy8jRyNGqpsyrlMusoLmnlP8AAP__AP7__n__AP8AKFSjepDGzcnNxs3GzMnPy8jRyNGqpsyrlMusoLmnlP8A__4QESF03OHBi8LW0zkAAAAAN-uRXEgBDEAAIgsJb4Vcq9cAAAAgBg&maxResults=10&q='0Bw3h_yCVtXbbQ1BzcU5TbXl1T1k'+in+parents+and+trashed%3Dfalse&fields=nextLink%2CnextPageToken%2Citems(description%2Cid%2Ctitle)%2CnextPageToken

... I get 1 item, and no nextPageToken, instead of the expected 8.

If I do the same thing from the API Explorer, I get 10 and 8 as expected. The difference is that the API Explorer gives a much shorter nextPageToken. I also noticed that the API Explorer gives status 200 for both GETs. My app is sometimes given 304, but isn't consistent. I suspect the significant difference is that my app has drive.file scope. This shouldn't be a problem, remember that if I request 20 I get all 18 files.

Some more testing, if I set ...

  • maxResults=4, I get 15 files.
  • maxResults=6 or 7 gives me 18 (woot!!).
  • maxResults=11 gives me 14
  • maxResults=12 gives me 14
  • maxResults=16 gives me (you won't believe this one ...) 24!. Yes 24 even though the folder only has 18 files. I've checked the returned file IDs and 6 of them are duplicated.

A public bug list would be very helpful right now!!

pinoyyid
  • 21,499
  • 14
  • 64
  • 115

1 Answers1

0

Looks like the answer is yes files.list() reproducibly returns incomplete list in "drive.files" scope. This bug has been outstanding since April

Community
  • 1
  • 1
pinoyyid
  • 21,499
  • 14
  • 64
  • 115