Skip to content

Commit 8fbe998

Browse files
committed
fix: list shares 5xx on already shared
1 parent 307589c commit 8fbe998

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)