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
davidklotz
8 years agoExplorer | Level 3
Handling renamed folders in list_folder / list_folder_continue
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
- 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.
- Greg-DBDropbox StaffHi 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. - WilksterExplorer | Level 3Try KrojamSoft BatchRename program,very useful
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,885 PostsLatest Activity: 42 minutes 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!