Skip to content

Commit 1fbb082

Browse files
committed
fix: list shares, avoid 5xx on any share already shared
1 parent 2868947 commit 1fbb082

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bugfix: Fix error on listing space members
2+
3+
Now the members list will still show grantees even with there is any invalid share after the upgrade.
4+
5+
https://github.com/owncloud/ocis/pull/11245
6+
https://github.com/owncloud/ocis/issues/11119

services/graph/pkg/service/v0/api_driveitem_permissions.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"net/http"
77
"net/url"
88
"slices"
9+
"strings"
910

1011
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
1112
grouppb "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1"
@@ -22,6 +23,7 @@ import (
2223
"go.opentelemetry.io/otel/trace"
2324

2425
revactx "github.com/owncloud/reva/v2/pkg/ctx"
26+
"github.com/owncloud/reva/v2/pkg/errtypes"
2527
"github.com/owncloud/reva/v2/pkg/publicshare"
2628
"github.com/owncloud/reva/v2/pkg/rgrpc/todo/pool"
2729
"github.com/owncloud/reva/v2/pkg/share"
@@ -462,8 +464,8 @@ func (s DriveItemPermissionsService) ListPermissions(ctx context.Context, itemID
462464
driveItems, err = s.listPublicShares(ctx, []*link.ListPublicSharesRequest_Filter{
463465
publicshare.ResourceIDFilter(itemID),
464466
}, driveItems)
465-
if err != nil {
466-
s.logger.Error().Err(err).Str("storageID", itemID.GetStorageId()).Msg("listPublicShares failed")
467+
s.logger.Error().Err(err).Str("storageID", itemID.GetStorageId()).Msg("listPublicShares failed")
468+
if err != nil && !strings.Contains(err.Error(), errtypes.ERR_ALREADY_EXISTS) {
467469
return collectionOfPermissions, err
468470
}
469471

0 commit comments

Comments
 (0)