Forum Discussion

Bob S.15's avatar
Bob S.15
Collaborator | Level 9
8 years ago

usersRoutes getCurrentAccount not returning

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

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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's avatar
      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's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox 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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,945 PostsLatest Activity: 7 hours ago
351 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!