cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn 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: 

ListFolderContinueAsync recursive not showing correct result

ListFolderContinueAsync recursive not showing correct result

mansi2821
Explorer | Level 4

-using dropbox.net SDK

-CodeSnippet

 

ListFolderResult listFolderResult;

listFolderResult = dropboxClient.Files.ListFolderAsync(controlpath,true, false, false, false, true, 200).Result;


var listfoldercontinuearg = new ListFolderContinueArg(cursor);
var listFolderResult = dropboxClient.Files.ListFolderContinueAsync(listfoldercontinuearg).Result;


using ablove code snippet, able to fetch chenges made on the home location (ie.:\\home).
but not able to fetch changes which are made on subfolder(ie.:\\home\subfolder)

4 Replies 4

Greg-DB
Dropbox Staff

Make sure you're retrieving and processing all of the pages from ListFolderAsync and ListFolderContinueAsync. You're not guaranteed to get everything back by just calling each one once. You need to keep calling ListFolderContinueAsync with the latest cursor until ListFolderResult.hasMore is false to be sure you've retrieved all of the entries. Refer to the ListFolderAsync documentation for more information.

 

If you're already doing so, please share the rest of the relevant code for reproducing this issue.

mansi2821
Explorer | Level 4

hello Thanks For your response here is my code 

 

ListFolderResult listFolderResult;

listFolderResult = dropboxClient.Files.ListFolderAsync(controlpath,true, false, false, false, true, 200).Result;

do
{

var listfoldercontinuearg = new ListFolderContinueArg(previousDeltaLink);

listFolderResult = dropboxClient.Files.ListFolderContinueAsync(listfoldercontinuearg).Result;

foreach (var entry in listFolderResult.Entries){}


if (listFolderResult.HasMore)
{
previousDeltaLink = listFolderResult.Cursor;

}

} while (previousDeltaLink.IsNotNullOrEmpty());

Greg-DB
Dropbox Staff

Can you clarify where/how the initial value of previousDeltaLink is being set though? In this code, it only seems to be set after each ListFolderContinueAsync call. I don't see where you're setting it from the initial call.

 

It looks like you are correctly setting the recursive parameter to true on the ListFolderAsync call, but you need to make sure you use that resulting cursor. Also, make sure you read out the entries from each page, including ListFolderAsync. I don't see you doing so in this code; you're only reading out the entries from ListFolderContinueAsync in this code.

mansi2821
Explorer | Level 4

 

hey my issue is solved 

 

Thanks for your response

Need more support?
Who's talking

Top contributors to this post

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