From 098ed082c8d8a7956bc0770aa401ef2748805601 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Thu, 25 Sep 2025 17:08:15 +0200 Subject: [PATCH] attempt to fix broken soft delete Signed-off-by: Christian Richter --- services/graph/pkg/service/v0/users.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/graph/pkg/service/v0/users.go b/services/graph/pkg/service/v0/users.go index 4f6900939..57c768623 100644 --- a/services/graph/pkg/service/v0/users.go +++ b/services/graph/pkg/service/v0/users.go @@ -710,7 +710,9 @@ func (g Graph) DeleteUser(w http.ResponseWriter, r *http.Request) { return } for _, sp := range lspr.GetStorageSpaces() { - if !(sp.SpaceType == _spaceTypePersonal && sp.Owner.Id.OpaqueId == user.GetId()) { + // if the spacetype equals _spaceTypePersonal and the owner id equals the user id + // then we found the personal space of the user to be deleted + if !(sp.GetSpaceType() == _spaceTypePersonal && sp.Owner.GetId().GetOpaqueId() == user.GetId()) { continue } // TODO: check if request contains a homespace and if, check if requesting user has the privilege to @@ -751,7 +753,8 @@ func (g Graph) DeleteUser(w http.ResponseWriter, r *http.Request) { } } - if g.config.UserSoftDeleteRetentionTime == 0 || (purgeUser && us.State == userstate.UserStateSoftDeleted) { + if (g.config.UserSoftDeleteRetentionTime > 0 && us.State == userstate.UserStateSoftDeleted && purgeUser) || + (g.config.UserSoftDeleteRetentionTime == 0) { logger.Debug().Str("id", user.GetId()).Msg("calling delete user on backend") err = g.identityBackend.DeleteUser(r.Context(), user.GetId()) if err != nil {