ip2k / google-api-ruby-client

Automatically exported from code.google.com/p/google-api-ruby-client
Apache License 2.0
0 stars 0 forks source link

Strange behaviour of google drive api call drive.files.list #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a folder in google drive
2. Add a file with the former created folder as parent
3. Make an api call like this:

client.execute({
  result = api_method: drive.files.list,
  parameters: {
    q: "'#{%%%% INSERT PARENT FOLDER ID HERE %%%%}' in parents" 
  }
4. Now upload another file into the parent folder and do the api-call in Step 3 
again

What is the expected output? What do you see instead?
If the parent folder contains only one file, the variable result.data.items 
holds an array of one Hash Item. 
If the folder contains two files, result.data.items returns an array with two 
Google::APIClient::Schema::Drive::V2::ParentReference objects.

I would expect, that both array should contain the same type of items.

What version of the product are you using? On what operating system?
I'm using ruby-1.9.3-p374 and google-api-client (0.6.2)

I hope I'm not missing something here.

Original issue reported on code.google.com by oliver.n...@zweitag.de on 25 Jan 2013 at 4:46

GoogleCodeExporter commented 9 years ago
Forgot to say that i use OS X 10.8.2

Original comment by oliver.n...@zweitag.de on 25 Jan 2013 at 4:49

GoogleCodeExporter commented 9 years ago
Trying to reproduce,  but in both cases I'm getting back the correct object 
type. Mostly same env -- OS X 10.8.2, ruby 1.9.3 (different patch level), 
ruby-api-client-0.6.2.

The bug description is a bit suspect. In the case of drive.files.list, the 
result should be of type Google::APIClient::Schema::Drive::V2::File, which is 
exactly what I'm getting. result.data.items shouldn't ever be a ParentReference 
for that query.

Can you attach code to reproduce & share the files/folders in question?

Original comment by sba...@google.com on 16 Feb 2013 at 12:24

GoogleCodeExporter commented 9 years ago
Same problem here.

I'm using the reference example of file "list" in ruby, the 
"retrieve_all_files" function.

It's returning an array of ParentReference

Original comment by jphorta....@gmail.com on 18 Feb 2013 at 4:00

GoogleCodeExporter commented 9 years ago
Still unable to reproduce. Could either of you:

- Check which version of autoparse you're using
- Attach a complete sample
- Try running with a different ruby version (e.g. 1.9.2)

complete sample is important here since I'm unable to reproduce with either of 
the two cases mentioned. There used to be a bug in autoparse < 0.3.2 that 
caused a similar issue, but only in certain cases. 

Original comment by sba...@google.com on 19 Feb 2013 at 3:19

GoogleCodeExporter commented 9 years ago
FYI, ran into a similar issue with another API and finally tracked this down to 
an issue in autoparse. The reason it wasn't reproducible is it depends on which 
methods are called and in which order which is why the complete sample was 
needed. Fortunately got this from another developer working on another API, but 
pretty sure the root cause is the same.

Will push a new version in the next couple of days with a fix.

Original comment by sba...@google.com on 26 Mar 2013 at 3:26

GoogleCodeExporter commented 9 years ago
The autoparse library has been updated to 0.3.3.

Original comment by sporkmonger on 26 Mar 2013 at 4:14

GoogleCodeExporter commented 9 years ago

Original comment by sba...@google.com on 26 Mar 2013 at 4:44