From e3a2a148ff8a6525a0244628e4c091395d9b30aa Mon Sep 17 00:00:00 2001 From: Julian Koberg Date: Tue, 28 Oct 2025 15:56:16 +0100 Subject: [PATCH] fix: [OCISDEV-449] fix user light creation Signed-off-by: Julian Koberg --- changelog/unreleased/fix-user-light-creation.md | 6 ++++++ ocis-pkg/shared/storage_utils.go | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/fix-user-light-creation.md diff --git a/changelog/unreleased/fix-user-light-creation.md b/changelog/unreleased/fix-user-light-creation.md new file mode 100644 index 00000000000..1b4168352d3 --- /dev/null +++ b/changelog/unreleased/fix-user-light-creation.md @@ -0,0 +1,6 @@ +Bugfix: Fix user light creation + +When trying to switch a user to user light before they logged in for the first time, an error would occur. +The server now correctly handles this case and allows switching to user light even before the first login. + +https://github.com/owncloud/ocis/pull/11765 diff --git a/ocis-pkg/shared/storage_utils.go b/ocis-pkg/shared/storage_utils.go index ca13f4747f9..e862c467e83 100644 --- a/ocis-pkg/shared/storage_utils.go +++ b/ocis-pkg/shared/storage_utils.go @@ -30,6 +30,10 @@ var ( func DisablePersonalSpace(ctx context.Context, client gateway.GatewayAPIClient, userID string) error { logger := appctx.GetLogger(ctx) sp, err := getPersonalSpace(ctx, client, userID) + if err == ErrNotFound { + logger.Debug().Str("userID", userID).Msg("no personal space found to delete") + return nil + } if err != nil { return fmt.Errorf("failed to retrieve personal space: %w", err) }