Skip to content

Commit

Permalink
fix sharejail stat id
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Sep 4, 2024
1 parent 5435685 commit 2964a28
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 receivedShare.MountPoint.Path == strings.TrimPrefix(req.Ref.Path, "./") {
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 2964a28

Please sign in to comment.