diff --git a/changelog/unreleased/use-share-api-spaces.md b/changelog/unreleased/use-share-api-spaces.md index 80c0f7f610..74b350a7ee 100644 --- a/changelog/unreleased/use-share-api-spaces.md +++ b/changelog/unreleased/use-share-api-spaces.md @@ -4,3 +4,4 @@ We now use the cs3 share Api to manage the space roles. We do not send the reque https://github.com/cs3org/reva/pull/2600 https://github.com/cs3org/reva/pull/2620 +https://github.com/cs3org/reva/pull/2687 diff --git a/internal/grpc/services/gateway/storageprovidercache.go b/internal/grpc/services/gateway/storageprovidercache.go index 0cf855d0e5..261810088f 100644 --- a/internal/grpc/services/gateway/storageprovidercache.go +++ b/internal/grpc/services/gateway/storageprovidercache.go @@ -232,7 +232,7 @@ func statKey(user *userpb.User, ref *provider.Reference, metaDataKeys []string) return "" } - key := "uid" + user.Id.OpaqueId + "!sid:" + ref.ResourceId.StorageId + "!oid:" + ref.ResourceId.OpaqueId + "!path:" + ref.Path + key := "uid:" + user.Id.OpaqueId + "!sid:" + ref.ResourceId.StorageId + "!oid:" + ref.ResourceId.OpaqueId + "!path:" + ref.Path for _, k := range metaDataKeys { key += "!mdk:" + k } diff --git a/internal/grpc/services/gateway/usershareprovider.go b/internal/grpc/services/gateway/usershareprovider.go index 88f2ab7cd4..13f38a96b1 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -661,6 +661,7 @@ func (s *svc) addSpaceShare(ctx context.Context, req *collaboration.CreateShareR switch st.Code { case rpc.Code_CODE_OK: s.cache.RemoveStat(ctxpkg.ContextMustGetUser(ctx), req.ResourceInfo.Id) + s.cache.RemoveListStorageProviders(req.ResourceInfo.Id) case rpc.Code_CODE_UNIMPLEMENTED: appctx.GetLogger(ctx).Debug().Interface("status", st).Interface("req", req).Msg("storing grants not supported, ignoring") default: @@ -764,6 +765,7 @@ func (s *svc) removeSpaceShare(ctx context.Context, ref *provider.ResourceId, gr }, err } s.cache.RemoveStat(ctxpkg.ContextMustGetUser(ctx), ref) + s.cache.RemoveListStorageProviders(ref) return &collaboration.RemoveShareResponse{Status: status.NewOK(ctx)}, nil }