Closed GoogleCodeExporter closed 9 years ago
Please use the library's http logging feature to provide a log of the request
and response that led to the assertion, as well as the full description of the
assertion.
https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Logging
_HTTP_Server_Traffic
Original comment by grobb...@google.com
on 27 Apr 2013 at 10:14
Here it is.
2013-04-28 16:53:57.618 YouTubeForKids[90712:cc0b] *** Assertion failure in
-[GTLService parseObjectFromDataOfFetcher:](),
/Users/tkormann/Documents/Wheepix/Projects/google-api-objectivec-client-read-onl
y/Source/Objects/GTLService.m:1145
Hope it helps.
Best Regards.
Original comment by thierry....@gmail.com
on 28 Apr 2013 at 3:08
Attachments:
It looks like the request has an invalid "fields" value. Try omitting that
property.
Original comment by grobb...@google.com
on 29 Apr 2013 at 11:20
Hi,
Thank for your answer. Indeed, not setting the "fields" property to my
GTLQueryYouTube fixes the assertion but now, as you know, in terms of data
transfer it's far from optimal.
Frankly, I still think there is an issue because given a bunch of video ids, I
have no way to know whether or not I should avoid (or not) the "fields"
property. In other words, there is no way to do a minimal query for a given set
of video ids if you are not sure all of them still exist at a given point in
time.
In fact, in my case, it would have even been more efficient to add a "fake"
videoId to my list just to be sure to get something, rather than transferring
all fields for all videos each time.
What do you recommend ?
Thanks.
Original comment by thierry....@gmail.com
on 30 Apr 2013 at 6:31
The fields parameter is safe, as far as I'm aware. But it can be tricky. Your
query had an invalid value for fields; try building the fields parameter up
slowly to get the desired response.
I usually add fields only as a final optimization once my app's queries are
working properly.
Original comment by grobb...@google.com
on 1 May 2013 at 12:54
Your answer makes me think I might not have been clear in my explanation. My
query works perfectly fine. All the fields are valid. If I perform my query
against a set of video ids that DO exist (not banned), everything works like a
charm.
It's only when I am running the query against a set of video ids and ALL of
them have been banned from YouTube, that I get the assertion failure.
For instance, running the query against 2 video ids, one that exists and one
that has been banned, it works. But if for some reason, I only have banned
videos in the query, I got the failure. This is why I do think there is an
issue.
So, the "fields" property can not be safely used except if you are absolutely
sure that at least one of the video id you specify using
"queryForVideosListWithIdentifier" has not been banned from YouTube.
Here is a code snippet:
NSString *videoIds = @"hK8lUKt35vM"; // OK
NSString *videoIds = @"j7V_8QpnafA"; // KO video banned
NSString *videoIds = @"hK8lUKt35vM, j7V_8QpnafA"; // OK one video not banned
NSString *videoIds = @"j7V_8QpnafA, ylUWojqQRp0"; // KO both videos are banned
GTLQueryYouTube *gtlQuery = [GTLQueryYouTube
queryForVideosListWithIdentifier:videoIds part:@"id,snippet,contentDetails"];
gtlQuery.fields =
@"items(id,snippet/title,snippet/thumbnails/medium,contentDetails/duration)";
[service executeQuery:gtlQuery completionHandler:^(GTLServiceTicket *ticket,
GTLYouTubeVideoListResponse *response,
NSError *error) { }];
Original comment by thierry....@gmail.com
on 1 May 2013 at 6:44
The GTLService.m class does not currently have an assertion on line 1145, so
I'm not certain what assert your code is hitting.
https://code.google.com/p/google-api-objectivec-client/source/browse/trunk/Sourc
e/Objects/GTLService.m#1145
Original comment by grobb...@google.com
on 13 May 2013 at 11:42
Original issue reported on code.google.com by
thierry....@gmail.com
on 27 Apr 2013 at 8:02