Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Implement soft deletes #9

Closed
JAORMX opened this issue Dec 14, 2022 · 0 comments · Fixed by #52
Closed

Implement soft deletes #9

JAORMX opened this issue Dec 14, 2022 · 0 comments · Fixed by #52
Assignees
Labels
good first issue Good for newcomers

Comments

@JAORMX
Copy link
Contributor

JAORMX commented Dec 14, 2022

All of the constructs need to be able to deal with hard deletion of nodes in the tree. Currently, the Directory API even has a deletedAt field which allows us to take soft deletions into account. the goal is to support soft deletes and appropriately portray this in the API.

This needs to be implemented in the following places:

Sample user flow

Deletion

  • A user with a custom built HTTP client calls delete on a node from the tree (Directory A). This will be an HTTP DELETE method.
  • The request hits the tree manager server which is able to accept the request.
  • The tree manager calls a delete method from the driver.
    • The driver doesn't fully delete the node, but instead just updates the "deleted at" property.
    • The driver also updates children from the directory (Directory B and Directory C) with the given "deleted at" property.

After deletion

  • A user uses a client to get the node Directory A.
    • This should return "not found"
  • A user attempts to get the parents of Directory A.
    • This should return in "not found", since, even if the parents of Directory A weren't deleted, Directory A should remain effectively inaccessible.
  • A user attempts to get the children of Directory A.
  • This should return "not found".
  • A user attempts to get Directory B.
    • This should return "not found" as the deletion should have trickled down to Directory A's children.

Caveats

  • One should not be able to simply delete a root directory (that is a directory without parents).
@JAORMX JAORMX added the good first issue Good for newcomers label Dec 14, 2022
@mikemrm mikemrm self-assigned this Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants