Skip to content

Commit

Permalink
Merge pull request cs3org#4930 from cs3org/fix/broken-favorites-grpc
Browse files Browse the repository at this point in the history
Fix broken removal of favourites
  • Loading branch information
diocas authored Nov 13, 2024
2 parents d7a0558 + 32c6304 commit 8a78778
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-fav-grpc.md
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8a78778

Please sign in to comment.