cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Check out the Dropbox cheat sheet for getting started in 2021 here!

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Folder delete event

Folder delete event

Collaborator | Level 8

When a folder is deleted it generates an event but there is only one event for the deletion even when the folder has many subfolders. 

The issue is we map each folder with equivalent entity in our app but when we only get event for top folder then there is no way for us to know what all folders are deleted.

Is there any way to find out all sub folders which got deleted when a folder is deleted? Or can we get event for each folder delete?

3 Replies 3

Re: Folder delete event

Dropboxer

No, there isn't a way to change this behavior. (You could technically list the deleted contents of a folder, but that would return all deleted contents, not just from the most recent deletion event.)

When a folder is deleted on the Dropbox filesystem, that indicates a deletion of all of its children as well. E.g., when processing list_folder entries:

"For each DeletedMetadata, if your local state has something at the given path, remove it and all its children."

That being the case, you should record the full path for each item so you can delete children when the parent is deleted.

Re: Folder delete event

Collaborator | Level 8

@Greg-DB wrote:

That being the case, you should record the full path for each item so you can delete children when the parent is deleted.


We do have all the paths, but paths are relative to user, so cant use path to delete folder entries. It may endup deleting other user entries with same path.

Re: Folder delete event

Dropboxer

I don't have full context on your app of course, but it sounds like in your case you'll need to keep track of the user IDs as well as the paths then.

Polls
Are you starting new work habits this year?

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?