cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and 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: 

Why should I remove the entry and all its children for each DeletedMetadata when using list_folder?

Why should I remove the entry and all its children for each DeletedMetadata when using list_folder?

dkoshenkov
Explorer | Level 4
Go to solution

Hello everyone,

 

I am keeping a local cache of the contents of my dropbox account using files/list_folder and files/list_folder/continue. There is a guide in the documentation on the exact steps that I need to perform to achieve that, which is absolutely great.

 

However, I cannot wrap my head around why for each DeletedMetadata I should delete the entry AND all of its children. I understand why we should delete the entry, but what about the children? Since the entry has been deleted in dropbox, this means that all of its children have also been deleted, which in turn means that every child of the entry will receive its own DeletedMetadata. I do not see the benefits of deleting the children together with the entry. 

 

If I delete only the entry itself whenever I get a DeletedMetadata and not delete its children, will my local cache be in sync with the dropbox contents? 

 

My uneducated guess would be that we need to do this because if we delete the parent without deleting its children, it would be impossible to delete the children, because we can no longer access them. However, this is not an issue in my case. Deleting parentless children is still possible in the database I am using.

 

Please let me know if I am missing anything. Perhaps, there is another reason to delete the children that I have not thought of?

 

Thank you for your time!

 

Kind regards,

Denis

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

You are not guaranteed to receive a DeletedMetadata entry for each child in the case where you receive a DeletedMetadata for the parent, so you should make sure to delete all of the children in your local cache as well whenever you receive a DeletedMetadata for a parent. If you do not do so, your local cache may get out of sync with the state on Dropbox.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

You are not guaranteed to receive a DeletedMetadata entry for each child in the case where you receive a DeletedMetadata for the parent, so you should make sure to delete all of the children in your local cache as well whenever you receive a DeletedMetadata for a parent. If you do not do so, your local cache may get out of sync with the state on Dropbox.

dkoshenkov
Explorer | Level 4
Go to solution

Hi Greg,

 

Thank you very much for the fast reply! I get it now.

Need more support?
Who's talking

Top contributors to this post

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