cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Folders with lots of files failing

Folders with lots of files failing

808phone
Explorer | Level 4

When I call listFolder like in the example code, *response is often nil.

This only happens with large numbers of files (over 1800, with some people 3000+ files).

 

DBFILESListFolderResult *response is nil.

 

This is a problem for my app.

 

 

[[client.filesRoutes listFolder:@"/test/path/in/Dropbox/account"]
    setResponseBlock:^(DBFILESListFolderResult *response, DBFILESListFolderError *routeError, DBRequestError *networkError) {
      if (response) {
        NSArray<DBFILESMetadata *> *entries = response.entries;
        NSString *cursor = response.cursor;
        BOOL hasMore = [response.hasMore boolValue];

        [self printEntries:entries];

        if (hasMore) {
          NSLog(@"Folder is large enough where we need to call `listFolderContinue:`");

          [self listFolderContinueWithClient:client cursor:cursor];
        } else {
          NSLog(@"List folder complete.");
        }
      } else {
        NSLog(@"%@\n%@\n", routeError, networkError);
      }
    }];
listFolder

 

4 Replies 4

808phone
Explorer | Level 4

So the problem is that I created 2 different calls. One for folders only and another for files. Apparently if there are enough files and it takes long enough, having the 2 calls at the same time will cause problems. I guess they cannot run concurrently without something happening. If I use just one routine, it works but is considerably slower than V1 I think.

Greg-DB
Dropbox Staff
If response is nil, make sure you check the routeError and networkError. One of them should contain an error message.

In any case, yes, you shouldn't make multiple concurrent listFolder[Continue] calls. A single listFolder[Continue] loop will return both files and folders under the requested path.

808phone
Explorer | Level 4

Greg,

 

The routine is much slower than V1 as well. The callback takes much longer. Is there going to be any improvement on this?

Greg-DB
Dropbox Staff
I can't make any promises, but I'm sending this along to the team as a request to improve performance here.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    808phone Explorer | Level 4
What do Dropbox user levels mean?