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: 

objc API: filesRoutes listFolder method not returning files

objc API: filesRoutes listFolder method not returning files

seanreilly
Explorer | Level 4
Go to solution

Hello,

My app has been on the iOS app store for years syncing successfully with dropbox. In the past few days many customers have encountered an error that seems to be a result of the following method not returning any files, but it does return one folder:

 

     [[dropbox.filesRoutes listFolder:@"/.moneydancesync/c135b3cc-c10c-4a7d-83de-be55ec2c7e96" recursive:@(NO) includeMediaInfo:@(NO) includeDeleted:@(NO) includeHasExplicitSharedMembers:@(NO)]

          setResponseBlock:^(DBFILESListFolderResult *result, DBFILESListFolderError * routeError, DBRequestError *networkError) {

  ...

}

 

Is there any reason this call would stop working all of a sudden?  Nothing changed on my side so I think it must be something on the dropbox/server side, or possibly that the underlying HTTP API has changed?

 

Please help, as I've got a lot of customers depending on my app's syncing via dropbox!

 

Thanks,

Sean

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

I see you're calling listFolder, but aren't calling listFolderContinue. You aren't always guaranteed to get all entries returned by calling just listFolder. You need to check the result, and if DBFILESListFolderResult.hasMore is true, call back to listFolderContinue to get more results (and the same for the listFolderContinue result). You can find more information in the listFolder documentation.

 

The requirement to check hasMore and use listFolderContinue as directed has always been part of API v2. Whether or not hasMore actually comes back as true in practice however depends on a variety of factors that can change over time, per account, and per path. Due to some backend updates, how often this does happen may be increased right now, but we're working on improving that. In any case though, you'll still need to have listFolderContinue implemented to guarantee that you get all of the results.

 

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

I see you're calling listFolder, but aren't calling listFolderContinue. You aren't always guaranteed to get all entries returned by calling just listFolder. You need to check the result, and if DBFILESListFolderResult.hasMore is true, call back to listFolderContinue to get more results (and the same for the listFolderContinue result). You can find more information in the listFolder documentation.

 

The requirement to check hasMore and use listFolderContinue as directed has always been part of API v2. Whether or not hasMore actually comes back as true in practice however depends on a variety of factors that can change over time, per account, and per path. Due to some backend updates, how often this does happen may be increased right now, but we're working on improving that. In any case though, you'll still need to have listFolderContinue implemented to guarantee that you get all of the results.

 

seanreilly
Explorer | Level 4
Go to solution

a minor update, I've updated to the latest objective-C SDK and the method call was tweaked to the code below but the results list still doesn't include any files, only the one subfolder.

 

[[dropbox.filesRoutes listFolder:self.remoteFolder 
                              recursive:@(NO)
                       includeMediaInfo:@(NO)
                         includeDeleted:@(NO)
        includeHasExplicitSharedMembers:@(NO)
                  includeMountedFolders:@(YES) 
                                  limit:nil 
                             sharedLink:nil 
                  includePropertyGroups:nil]
          setResponseBlock:^(DBFILESListFolderResult *result, DBFILESListFolderError * routeError, DBRequestError *networkError) {
...
}]

Thanks,

Sean

seanreilly
Explorer | Level 4
Go to solution

Thanks for the fix!  I should've known that as I made the same change on Android years ago.

Need more support?
Who's talking

Top contributors to this post

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