Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Changes list return the entire list of changes even if maxresult = 1 #34

Closed
GoogleCodeExporter opened this issue Aug 11, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

I need to make a dummy request just to receive the largestChangeID, so I make a 
request to the list changes 
(https://developers.google.com/drive/v2/reference/changes/list) with maxResult 
1 to just obtain the largestChangeID. 

1. Execute a request with no need of paginate the results (for example set 
maxResult = 1)


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GET https://www.googleapis.com/drive/v2/changes?maxResults=1&key={YOUR_API_KEY}

Authorization:  Bearer 
ya29.AHES6ZSZzp5Asp02vdKmAiNbCs1cuvBFxvy2L3g8Mae05uDrABIBtTs
X-JavaScript-User-Agent:  Google APIs Explorer
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


2. The request contains no items, but a nextPageToken is returned (This must be 
a defect in the API). 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
 "kind": "drive#changeList",
 "etag": "\"GesfazbRwXf_7avgrxTp0sjPQkU/BAblAFB_YsAZHzKV9V2HFOof83U\"",
 "selfLink": "https://www.googleapis.com/drive/v2/changes?maxResults=1",
 "nextPageToken": "4",
 "nextLink": "https://www.googleapis.com/drive/v2/changes?maxResults=1&pageToken=4",
 "largestChangeId": "2870",
 "items": [
 ]
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

3. GTLServiceDrive should have shouldFetchNextPages = YES

What is the expected output? What do you see instead?

The expected result it's just the one I can see in the raw response. 
Instead as a pageToken is present in the response, GTLServiceDrive start 
fetching all the next pages retrieving the entire list of changes in the 
account. 

I think that the problem is the API returning a nextPageToken when no necessary.


Original issue reported on code.google.com by p...@archyapp.com on 9 May 2013 at 5:16

@GoogleCodeExporter
Copy link
Author

The service probably has its shouldFetchNextPages property set. Be sure to turn 
that off for the service or the ticket.

https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Result_
Pages

Original comment by grobb...@google.com on 14 May 2013 at 12:20

@GoogleCodeExporter
Copy link
Author

Basically maxResults is a kind of "max results for page", it make sense. 
Is there a request I can make to retrieve only the changeID?

Original comment by p...@archyapp.com on 15 May 2013 at 3:20

@GoogleCodeExporter
Copy link
Author

The Drive API allows query (q) parameters to specify what gets returned. See 
the DriveSample app and Drive API documentation and discussion areas for more 
details.

Original comment by grobb...@google.com on 15 May 2013 at 10:55

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Makes sense, thanks.

Original comment by p...@archyapp.com on 21 May 2013 at 10:07

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant