Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sharejail stat #4835

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading