Hi all,
while working on participants being able to create/delete/move files
during a sessions, I stumbled about a corner case: How should we handle
deletions of non-shared resources on the receiving side.
As an easy example:
Alice and Bob start a partial session on the following directory structure:
Directory A contains the directories B and C.
directory A
|-> directory B
|-> directory C
In the session, only the directories A and C are shared, B is *not* shared.
What should now happen on Bob's side if Alice deletes(/moves/renames)
the directory A? This issue gets exacerbated by the fact that non-shared
directories don't have to exist for every client, meaning Alice might
not even know that she would also be deleting other directories for Bob.
Franz's suggestion was to look at how Saros/E handles the situation.
While testing the behavior, I noticed that deleting/moving/renaming
shared files in a partial session are not possible in Saros/E (see
GitHub issue 235:
https://github.com/saros-project/saros/issues/235).
So now I am looking for a sensible behavior to handle such cases.
I can currently think of four possible approaches:
1. Handle these directories as though they were shared.
2. Just mark the deleted(/moved/renamed) shared directories as not
shared instead of really deleting them, thereby removing them from the
session while still maintaining the correct path for the initial
non-shared resources.
This approach still leaves the issue of how to handle subsequent
re-creations of the deleted(/moved/renamed) directories. Or in other
words, how do we handle the creation of resources that already exist as
non-shared resources for other participants?
3. Move the non-shared resources up the directory tree until they are
located in a valid directory.
4. Ask the user how to handle the non-shared resources. Offer options
like "Move the resource to a new directory", "Delete the resource", etc.
This approach might be the most user friendly but is might also be very
cumbersome if many non-shared resources are affected (as we should
probably create a dialog for each affected base directory).
I would appreciate your input on the situation and my suggested
approaches or other suggestions on how to handle such situations.
Best regards,
Tobias