Skip to content

Commit 32c6304

Browse files
committed
Fixed broken removal of favourites
1 parent d7a0558 commit 32c6304

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

changelog/unreleased/fix-fav-grpc.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: make removal of favourites work
2+
3+
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.
4+
5+
https://github.com/cs3org/reva/pull/4930

pkg/eosclient/eosgrpc/eosgrpc.go

+9
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,15 @@ func (c *Client) UnsetAttr(ctx context.Context, auth eosclient.Authorization, at
602602
log := appctx.GetLogger(ctx)
603603
log.Info().Str("func", "UnsetAttr").Str("uid,gid", auth.Role.UID+","+auth.Role.GID).Str("path", path).Msg("")
604604

605+
// Favorites need to be stored per user so handle these separately
606+
if attr.Type == eosclient.UserAttr && attr.Key == favoritesKey {
607+
info, err := c.GetFileInfoByPath(ctx, auth, path)
608+
if err != nil {
609+
return err
610+
}
611+
return c.handleFavAttr(ctx, auth, attr, recursive, path, info, false)
612+
}
613+
605614
// Initialize the common fields of the NSReq
606615
rq, err := c.initNSRequest(ctx, auth, app)
607616
if err != nil {

0 commit comments

Comments
 (0)