We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
manishrc
5 years agoExplorer | Level 4
Handling File Rename/Move in the API [filesListFolderContinue]
Hello, I'm trying to build a blogging platform powered by markdown files in dropbox. So, I need to keep the file and the blog in sync. To do this, I am using filesListFolderContinue (JS SDK)...
- 5 years ago
I'm currently using the id field to track move/renames. But the problem was basically that I am unable to differentiate a DELETE from a MOVE. It's not a big problem if some of the actions are idempotent, but unfortunately, they are.
Does dropbox have any plans to fix this behavior and allow the ability to differentiate between a DELETE and a MOVE?
No, I'm not aware of plans to change how this works. If this case is common for your app and it's more effective for your app to process these filesListFolder entries together, you could consider adding a small delay after receiving a 'deleted' entry to catch the potential following additions.
You can also use filesListFolderLongpoll to get low-latency monitoring for changes.
Does this avoid the previous problem?
No, this doesn't avoid the issue, but I mentioned it as it may make things faster in your app since it's a way to quickly detect changes. E.g., if you query and get just the deletion, the longpoll would let you know about any further changes, such as an addition, as soon as possible.
Also, is there a reason why the id is not included in the deleted files?
This is due to how the Dropbox filesystem is implemented. The 'deleted' entry just indicates that something used to exist at that path, but does not itself have the id of that item (or item(s)) that used to be there.
Greg-DB
5 years agoDropbox Staff
There can be a slight delay between new entries like this, as you found. The deletion and addition of a file for a rename or move operation aren't guaranteed to be delivered together, so if you happen to call at the right time you might see the deletion without the addition. If you later call back again to filesListFolderContinue using that returned cursor, you should then see the addition though, so once you process all of the entries the result should be the same.
You can also use filesListFolderLongpoll to get low-latency monitoring for changes.
Also, note that you can track the Metadata.id for the original file and then the addition of the file at the new path to keep track of files across moves/renames, since the file ID won't change for moves/renames.
- manishrc5 years agoExplorer | Level 4
Hi Greg,
Thank you for your quick reply.
I'm currently using the id field to track move/renames. But the problem was basically that I am unable to differentiate a DELETE from a MOVE. It's not a big problem if some of the actions are idempotent, but unfortunately, they are.
Does dropbox have any plans to fix this behavior and allow the ability to differentiate between a DELETE and a MOVE?
You can also use filesListFolderLongpoll to get low-latency monitoring for changes.
Does this avoid the previous problem?
Also, is there a reason why the id is not included in the deleted files?
- Greg-DB5 years agoDropbox Staff
I'm currently using the id field to track move/renames. But the problem was basically that I am unable to differentiate a DELETE from a MOVE. It's not a big problem if some of the actions are idempotent, but unfortunately, they are.
Does dropbox have any plans to fix this behavior and allow the ability to differentiate between a DELETE and a MOVE?
No, I'm not aware of plans to change how this works. If this case is common for your app and it's more effective for your app to process these filesListFolder entries together, you could consider adding a small delay after receiving a 'deleted' entry to catch the potential following additions.
You can also use filesListFolderLongpoll to get low-latency monitoring for changes.
Does this avoid the previous problem?
No, this doesn't avoid the issue, but I mentioned it as it may make things faster in your app since it's a way to quickly detect changes. E.g., if you query and get just the deletion, the longpoll would let you know about any further changes, such as an addition, as soon as possible.
Also, is there a reason why the id is not included in the deleted files?
This is due to how the Dropbox filesystem is implemented. The 'deleted' entry just indicates that something used to exist at that path, but does not itself have the id of that item (or item(s)) that used to be there.
- manishrc5 years agoExplorer | Level 4Thank you for your help.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 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!