本文介绍了驱动器中的分页是否中断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含18个文件的文件夹。如果我做了一个maxResults = 20的列表,我得到了所有18个。到目前为止这样好。

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

如果我设置maxResults = 10,我得到10和...

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.

如果我然后使用pageToken请求另一个10, p>

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

...我得到了1项,并没有nextPageToken,而不是预期的8.

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

如果我从API Explorer中做同样的事情,我得到10和8的预期。不同之处在于API Explorer提供了更短的nextPageToken。我还注意到API Explorer为两个GET提供了状态200。我的应用程序有时会给出304,但不一致。我怀疑,显着的区别是我的应用程序具有drive.file范围。这不应该是一个问题,请记住,如果我请求20我得到所有18个文件。

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,我得到15个文件。

  • maxResults = 6或7给我18(woot !!)。
  • maxResults = 11给我14

  • maxResults = 12给我14

  • maxResults = 16给我(你不会相信这个......)24 !.是的,即使该文件夹只有18个文件。我检查了返回的文件ID,其中6个重复。

  • 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.

公共bug列表现在会非常有用!

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

推荐答案

看起来答案是肯定的。这个错误自4月份以来一直很出色

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

这篇关于驱动器中的分页是否中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 16:41