cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

usersRoutes getCurrentAccount not returning

usersRoutes getCurrentAccount not returning

Bob S.15
Collaborator | Level 9

Hello,

 

  I'm trying to track down a sporadic issue that occurs when access to an internet connection is sporadic, or maybe when there's a Wifi Network but it requires a security login?  In trying to reproduce this error, I am leaving my router on but turning off the cable modem to see if that will cause the problem.

 

[DBClientsManager authorizedClient] is non-nil, I guess because it remembers that the user was already logged in.  Then it tries this call: [[[DBClientsManager authorizedClient].usersRoutes getCurrentAccount] setResponseBlock:^(DBUSERSFullAccount *account, DBNilObject *_, DBRequestError *error).

 

I've got a debugger breakpoint set inside the response block, and when there's no connection to the internet, this function just doesn't ever seem to return at all.  Is that expected?  Shouldn't I get an error in the response block?  If I reconnect the modem then the function finally does enter the response block.

 

Thanks

Bob

 

 

4 Replies 4

Greg-DB
Dropbox Staff
Hi Bob, the expected behavior here should be either an immediate error indicating the lack of network connection, or a delayed error indicating the request timed out, depending on exactly how it failed.

Can you let me know:
- the version of the SDK you're using
- the version(s) of iOS you're seeing this with
- the code you're using to reproduce this
- how long you're waiting for the response (before reconnecting the modem)

Thanks in advance!

Bob S.15
Collaborator | Level 9

Hey Greg,

 

- How can I tell the SDK version?  I think it is 3.0.11 because I have this for my Cartfile: “github "https://github.com/dropbox/dropbox-sdk-obj-c" == 3.0.11”

  I think I have that because it is the last version to support iOS 8, is that correct?

 

- the iOS version is 10.3.1

 

- this is the code:

 

-(void)getDropboxAccountData:(UIViewController *)VC  {
    
    [[[DBClientsManager authorizedClient].usersRoutes getCurrentAccount] setResponseBlock:^(DBUSERSFullAccount *account, DBNilObject *_, DBRequestError *error) {
        printf("getCurrentAccount returned");
        if (account) {
            NSLog(@"%@", account);
            [self loadedDropboxAccountInfo:account.name.displayName];
        } else if (error) {
            [self loadDropboxAccountInfoFailed];
            NSLog(@"%@", error);
        }
    }];
}

 

 

- I waited 5 minutes without a response, should it take that long?

 

Thanks

Bob

 

Greg-DB
Dropbox Staff

Thanks! Yes, 3.0.11 is the version number I'm looking for.

 

And 5 minutes should have been sufficient for it to time out. (I believe the default timeout is 60 seconds.)

 

We're looking into it.

Greg-DB
Dropbox Staff

Apologies for the delay. This should be fixed in v3.6.0.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Bob S.15 Collaborator | Level 9
What do Dropbox user levels mean?