i have a collapsable tree view UI with virtual files and folders which can be simultaneously edited by multiple users. my problem starts when i try to figure out how to deal with cases in which one user action completely override another user action.

for instance: user A decides to remove a folder with all of its contents while user B is editing a file inside that folder.

technically, user B's UI will know that something is wrong only when it tries to save the changes on this file.

how should i tackle this?

  • disable removing of a folder while it's contents are being edited by another user?

  • decline saving changes on that file until it is dragged to an existing folder?

both solutions sounds bad and require a lot of infrastructure work to achieve.


  • How about re-create subtree on save? Also provide some metadata (author, datetime) for the created/changed objects, to help to recognize the responsibility. Apr 10, 2016 at 16:12
  • for me this is kind of unexpected behaviour. looking for something more standard that i must have missed..
    – Gilad
    Apr 10, 2016 at 16:25

1 Answer 1


I would try to prevent the worst case scenario that is performing an action that could cause problems to someone without that person being able to prevent it, so if had to choose just between the options you mentioned I'd choose the first:

"disable removing of a folder while it's contents are being edited by another user"

There might be some edge case, where you have to delete something for security or stability reasons, if that's the case it will require more analysis.

But in fact we should first analyze what is root problem here.


If a coworker is working in a file and everybody knows that, will someone try to delete that folder? Probably not.

So you can do two things here:

  1. Show what folders/files are being edited, to prevent users to delete something without knowing that other people is working on that.
  2. When trying to delete a file/folder show a pop-up that describes the situation and let the user send a message or request to delete that file to the person/people who's editing it.
  • I have never seen a whole-folder-with-all-files-lock while working in Windows, Linux or Mac.. only some applications (notoriously MS Office) make a file lock while editing, while other applications (e.g. Notepad++) do not use any file locks and just detect conflicts (e.g. pop-up notification if a file was changed, option to create new file if file was deleted)
    – Aprillion
    Apr 16, 2016 at 17:28
  • @Aprillion you are right, it's happens only with some software, I'm editing thanks for the comment. Apr 16, 2016 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.