diff --git a/changelog/unreleased/fix-fav-grpc.md b/changelog/unreleased/fix-fav-grpc.md new file mode 100644 index 0000000000..e5d5645b35 --- /dev/null +++ b/changelog/unreleased/fix-fav-grpc.md @@ -0,0 +1,5 @@ +Bugfix: make removal of favourites work + +Currently, removing a folder from your favourites is broken, because the handleFavAttr method is only called in SetAttr, not in UnsetAttr. This change fixes this. + +https://github.com/cs3org/reva/pull/4930 \ No newline at end of file diff --git a/pkg/eosclient/eosgrpc/eosgrpc.go b/pkg/eosclient/eosgrpc/eosgrpc.go index 22f46e590c..f5f6bdcfac 100644 --- a/pkg/eosclient/eosgrpc/eosgrpc.go +++ b/pkg/eosclient/eosgrpc/eosgrpc.go @@ -602,6 +602,15 @@ func (c *Client) UnsetAttr(ctx context.Context, auth eosclient.Authorization, at log := appctx.GetLogger(ctx) log.Info().Str("func", "UnsetAttr").Str("uid,gid", auth.Role.UID+","+auth.Role.GID).Str("path", path).Msg("") + // Favorites need to be stored per user so handle these separately + if attr.Type == eosclient.UserAttr && attr.Key == favoritesKey { + info, err := c.GetFileInfoByPath(ctx, auth, path) + if err != nil { + return err + } + return c.handleFavAttr(ctx, auth, attr, recursive, path, info, false) + } + // Initialize the common fields of the NSReq rq, err := c.initNSRequest(ctx, auth, app) if err != nil {