userli icon indicating copy to clipboard operation
userli copied to clipboard

Replace soft-deletion with list of used addresses?

Open doobry-systemli opened this issue 6 years ago • 2 comments

At the moment, we use a soft-deletion feature for users and aliases: instead of removing them from the database at deletion, we mark them as deleted. This is required in order to prevent impersonation (i.e. re-registration of a formerly used address).

A simpler solution would be to create a new entity UsedAddresses and put deleted aliases and user addresses in there.

Advantages:

  • Get rid of the soft-deletion logic for entities User and Alias
  • Get rid of any metadata for deleted objects. No need to clean deleted objects, just remove them

Possible disadvantages:

  • No longer possible to use remaining metadata of deleted objects (creationTime, updateTime and Vouchers)

doobry-systemli avatar Oct 09 '18 15:10 doobry-systemli

I now understand why this makes sense. Our current approach produces side-effects like #61. User and Alias use different logic to implement the soft-deleted state.

Couldn't we re-use ReservedName? Conceptually, they are the same thing. It's just a name that is not allowed for users to register again. I think it would make sense to append the name to this list.

To enable this, we would need to make sure that ReservedName can be domain-specific, which makes sense anyway.

t2d avatar Nov 06 '18 16:11 t2d

Wenn wir softdeletion behalten wollen, wäre das vllt ein besserer weg als es selber zu implementieren: https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/softdeleteable.md

t2d avatar Nov 20 '18 21:11 t2d