Skip to content

Commit

Permalink
Merge pull request cs3org#4835 from butonic/fix-sharejail-stat-id
Browse files Browse the repository at this point in the history
Fix sharejail stat
  • Loading branch information
butonic authored Sep 30, 2024
2 parents e61012b + 02af5a2 commit c33c803
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-sharejail-stat-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix sharejail stat id

Stating a share jail mountpoint now returns the same resourceid as in the directory listing of the share jail root.

https://github.com/cs3org/reva/pull/4835
https://github.com/owncloud/ocis/issues/9933
Original file line number Diff line number Diff line change
Expand Up @@ -789,21 +789,26 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide
return nil, err
}

// TODO return reference?
return gatewayClient.Stat(ctx, &provider.StatRequest{
statRes, err := gatewayClient.Stat(ctx, &provider.StatRequest{
Opaque: req.Opaque,
Ref: buildReferenceInShare(req.Ref, receivedShare),
ArbitraryMetadataKeys: req.ArbitraryMetadataKeys,
})
if err != nil {
return nil, err
}

// FIXME when stating a share jail child we need to rewrite the id and use the share
// when stating a share jail mountpoint we need to rewrite the id and use the share
// jail space id as the mountpoint has a different id than the grant
// but that might be problematic for eg. wopi because it needs the correct id? ...
// ... but that should stat the grant anyway

// FIXME when navigating via /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668 the web ui seems
// to continue navigating based on the id of resources, causing the path to change. Is that related to WOPI?
if statRes.GetStatus().GetCode() == rpc.Code_CODE_OK && receivedShare.MountPoint.Path == strings.TrimPrefix(req.Ref.Path, "./") && statRes.Info != nil {
statRes.Info.Id = &provider.ResourceId{
StorageId: utils.ShareStorageProviderID,
SpaceId: utils.ShareStorageSpaceID,
OpaqueId: receivedShare.GetShare().GetId().GetOpaqueId(),
}
}

return statRes, nil
}

func (s *service) ListContainerStream(req *provider.ListContainerStreamRequest, ss provider.ProviderAPI_ListContainerStreamServer) error {
Expand Down

0 comments on commit c33c803

Please sign in to comment.