From 61a54212db21b88abf0294d7a6783db559e51b7d Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Tue, 4 Jun 2024 12:19:21 +0200 Subject: [PATCH] fix: space listing when user has no personal space --- changelog/unreleased/fix-user-group-index.md | 5 +++++ pkg/storage/utils/decomposedfs/spaces.go | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-user-group-index.md diff --git a/changelog/unreleased/fix-user-group-index.md b/changelog/unreleased/fix-user-group-index.md new file mode 100644 index 0000000000..c4a824867e --- /dev/null +++ b/changelog/unreleased/fix-user-group-index.md @@ -0,0 +1,5 @@ +Bugfix: Tolerate missing user space index + +We fixed a bug where the spaces for a user were not listed if the user had no space index by user. This happens when a user has the role "User Light" and has been invited to a project space via a group. + +https://github.com/cs3org/reva/pull/4710 diff --git a/pkg/storage/utils/decomposedfs/spaces.go b/pkg/storage/utils/decomposedfs/spaces.go index c8e644ee12..a635db2da0 100644 --- a/pkg/storage/utils/decomposedfs/spaces.go +++ b/pkg/storage/utils/decomposedfs/spaces.go @@ -325,7 +325,8 @@ func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provide if requestedUserID != nil { allMatches, err = fs.userSpaceIndex.Load(requestedUserID.GetOpaqueId()) - if err != nil { + // do not return an error if the user has no spaces + if err != nil && !os.IsNotExist(err) { return nil, errors.Wrap(err, "error reading user index") }