Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't reuse names of deleted accounts #995

Open
malfynnction opened this issue Mar 22, 2024 · 2 comments
Open

Can't reuse names of deleted accounts #995

malfynnction opened this issue Mar 22, 2024 · 2 comments
Labels
bug Something isn't working as supposed to

Comments

@malfynnction
Copy link

Describe the bug
If I want to reuse the name of a deleted account, I get the error message the account name must be unique for the budget

To Reproduce
Steps to reproduce the behavior:

  1. Create a new account named "foo"
  2. Delete that account
  3. Try creating a new account named "foo"
  4. See error

Expected behavior
Deleted accounts should not be considered for name uniqueness

@malfynnction malfynnction added the bug Something isn't working as supposed to label Mar 22, 2024
@morremeyer morremeyer added this to the Delete & Restore milestone Apr 2, 2024
@morremeyer
Copy link
Member

morremeyer commented Apr 2, 2024

This is trickier to solve than I thought at first. My two main points are:

  • Soft-deleted resources need to be considered for uniqueness since they can be restored
  • I do not think we should keep soft-deleted resources around forever. A trash bin mechanism where they get deleted after e.g. 30 days. The main reason why I implemented soft deletion in the beginning was to enable the "ooops, I deleted that accidentally, restore it now" workflow, not to keep them around forever.

With these, I arrive at the following:

  • Resources continue to be soft-deleted
  • After 30 days, they get cleaned up by a background task in the backend
  • As described in Enable querying of deleted resources #252, it needs to be possible to get a list of deleted resources.
  • As described in Enable restoring of deleted resources  #253, it needs to be possible to restore these
  • Additionally, it should be possible to immediately delete a soft-deleted resource permanently via the API (needs a new issue or can be implemented via this issue)

@malfynnction What do you think about this? Should we discuss and document the frontend implementation for what would be needed here?

Thanks to @ekeih for discussing this with me from a user perspective.

@morremeyer morremeyer added enhancement New feature or improvements to an existing one and removed bug Something isn't working as supposed to labels Apr 2, 2024
@morremeyer morremeyer added the bug Something isn't working as supposed to label Apr 28, 2024
@morremeyer
Copy link
Member

morremeyer commented Apr 28, 2024

This is both a bug and describes a possible enhancement:

Bug

There is currently no way via the API to re-use names since soft deleted resources cannot be restored or permanently deleted.

This will be fixed by allowing to query, un-delete and permanently delete soft-deleted resources.

Feature

Introduce the trashbin-like mechanism with an expiration of 30 days described above that automatically cleans up deleted resources.

This should be disabled by default for now, since enabling it will be a breaking change.

This is tracked in #1025 now.
#995 will only deal with fixing the bug

@morremeyer morremeyer removed the enhancement New feature or improvements to an existing one label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as supposed to
Projects
None yet
Development

No branches or pull requests

2 participants