samjee / google-api-objectivec-client

Automatically exported from code.google.com/p/google-api-objectivec-client
0 stars 0 forks source link

Upload Execute Query hangs #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Log into YouTube using iOS SDK and specific client ID/Secret
2. Upload video, works fine
3. Change app to use another client ID/Secret
4. attempt to upload video
5. executeQuery (queryForVideosInsertWithObject) just hangs and never calls 
completionHandler
6. log out, log back in, works fine

What is the expected output? What do you see instead?
- an error message 
- ideally when we check auth.canAuthorize it reports NO

What version of the product are you using? On what operating system?
 3.0 sdk for ios

Please provide any additional information below.

Now this is an extreme example. We've had users hit the same "hang" out in the 
field where the cid/secret are not changing on them. So, did their login expire 
or something else? They can always fix it by logging out and back in. 

We followed the example code for determining if someone is signed in, which is 
below. If there's something further we should check. I've looked at 
expirationDate and expiresIn and they are no help.

- (NSString *)signedInName {
    // Get the email address of the signed-in user
    GTMOAuth2Authentication *auth = [[self youTubeService] authorizer];
    BOOL isSignedIn = auth.canAuthorize;
    if (isSignedIn) {
        return auth.userEmail;
    } else {
        return nil;
    }
}

- (BOOL)loggedIn {
    return [self signedInName]!=nil;
}

Original issue reported on code.google.com by jhalst...@gmail.com on 5 Sep 2013 at 2:10

GoogleCodeExporter commented 9 years ago
I don't understand how "Change app to use another client ID/Secret" happens in 
a running app.

If a completion handler isn't called, then either the query is being started on 
a background thread without a run loop spinning, or an exception fired. Check 
the console output or the debugger.

Also observe the kGTMOAuth2AccessTokenRefreshFailed notification, as that 
indicates when a user's authentication has been explicitly revoked (typically 
from the google.com/accounts page.)

Original comment by grobb...@google.com on 5 Sep 2013 at 8:38

GoogleCodeExporter commented 9 years ago
It was between runs of the app and I spent the longest time trying to figure 
out why uploading wasn't working anymore and accidentally stumbled on the log 
out/back in. It makes total sense that you can't use the same authorization 
with a new ID/Secret, but I thought it was odd that this was where it was 
getting stuck.

I'll check to see if there's an exception running. The code is always called in 
the same manner (same thread) so I don't see how that could be happening.

kGTMOAuth2AccessTokenRefreshFailed - good to know!  Thanks. 

Original comment by jhalst...@gmail.com on 5 Sep 2013 at 8:43