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: 

Handling renamed folders in list_folder / list_folder_continue

Handling renamed folders in list_folder / list_folder_continue

davidklotz
Explorer | Level 3
Go to solution

Hi, 

 

our users can choose specific folders that they want to synchronize from Dropbox to our app*. We store the current list_folder/list_folder_continue cursor in our database, so we only get changed files. This is working fine, as long as the "subscribed" folders are never moved/renamed. If a user does that, the list_folder_continue call fails with (even though we didn't use a path, we used a cursor): 

Exception in 2/files/list_folder/continue: {".tag":"path", "path":"not_found"}

 

We already had this problem using the V1 API and I had great hopes when I read that there's ID support in the V2 API (so we could use the same ID, regardless if the folder was renamed), but so far this isn't really working out because of two problems:

  • First, the initial list_folder call (when we don't have a cursor, yet) can't use the ID, since IDs are not supported for list_folder, so if the user has renamed the folder in the meantime, we can basically only skip it.
  • Second, as described above, the cursors for list_folder_continue also seem to be path-based and stop working when a folder is moved or renamed.

So, what's the recommended way to deal with this situation? So far, all I can see that we can do is stop synchronizing that folder and ask our users to choose folders again if they want the renamed folder to be included.

 

Cheers, 

David

 

* fileee.com

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
Hi David, thanks for the post. Unfortunately, there isn't a good solution to this right now. File IDs were introduced to help with issues like this, but as you mentioned, list_folder doesn't currently support file IDs.

You could also keep track of a list_folder cursor for the entire account structure (i.e., list_folder on the root path: "") and use the desired folder's ID to check the results to see if/where the folder moved, though that would be a bit of work.

We are planning on expanding file ID support in API v2, so that would be the best solution here. I've sent this along as a feature request for file ID support for list_folder. I can't make a firm promise as to when this would be available, but I'll follow up here once it is.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution
Hi David, thanks for the post. Unfortunately, there isn't a good solution to this right now. File IDs were introduced to help with issues like this, but as you mentioned, list_folder doesn't currently support file IDs.

You could also keep track of a list_folder cursor for the entire account structure (i.e., list_folder on the root path: "") and use the desired folder's ID to check the results to see if/where the folder moved, though that would be a bit of work.

We are planning on expanding file ID support in API v2, so that would be the best solution here. I've sent this along as a feature request for file ID support for list_folder. I can't make a firm promise as to when this would be available, but I'll follow up here once it is.

Wilkster
Explorer | Level 3
Go to solution
Try KrojamSoft BatchRename program,very useful
Need more support?
Who's talking

Top contributors to this post

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