You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
seanreilly
7 years agoExplorer | Level 4
objc API: filesRoutes listFolder method not returning files
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
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.
- Greg-DBDropbox Staff
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.
- seanreillyExplorer | Level 4
Thanks for the fix! I should've known that as I made the same change on Android years ago.
- seanreillyExplorer | Level 4
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
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,912 PostsLatest Activity: 2 months agoIf 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!