Skip to content

Commit

Permalink
fix space name when listing personal spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Oct 22, 2021
1 parent 84a5191 commit 8d780d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/update-storage-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Added the UpdateStorageSpace method to the decomposedfs.

https://github.com/cs3org/reva/pull/2162
https://github.com/cs3org/reva/pull/2195
https://github.com/cs3org/reva/pull/2196
10 changes: 6 additions & 4 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, node *node.Nod

// TODO apply more filters

sname, err := xattr.Get(node.InternalPath(), xattrs.SpaceNameAttr)
if err != nil {
return nil, err
}
space := &provider.StorageSpace{
// FIXME the driver should know its id move setting the spaceid from the storage provider to the drivers
//Id: &provider.StorageSpaceId{OpaqueId: "1284d238-aa92-42ce-bdc4-0b0000009157!" + n.ID},
Expand All @@ -334,20 +338,18 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, node *node.Nod
//StorageId: "1284d238-aa92-42ce-bdc4-0b0000009157",
OpaqueId: node.ID,
},
Name: node.Name,
Name: string(sname),
SpaceType: spaceType,
// Mtime is set either as node.tmtime or as fi.mtime below
}

switch space.SpaceType {
case "project":
default:
sname, err := xattr.Get(node.InternalPath(), xattrs.SpaceNameAttr)
if err != nil {
return nil, err
}
space.Name = string(sname)
default:
space.Name = "root"
}

user := ctxpkg.ContextMustGetUser(ctx)
Expand Down

0 comments on commit 8d780d3

Please sign in to comment.