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

DriveItem ID from listSharedWithMe doesn't match with shared resource id #8420

Closed
amrita-shrestha opened this issue Feb 9, 2024 · 2 comments · Fixed by #8467
Closed

DriveItem ID from listSharedWithMe doesn't match with shared resource id #8420

amrita-shrestha opened this issue Feb 9, 2024 · 2 comments · Fixed by #8467
Assignees
Labels
Milestone

Comments

@amrita-shrestha
Copy link
Contributor

amrita-shrestha commented Feb 9, 2024

Describe the bug

RemoteItemId doesn't match with shared resource id of share drive propfind

Steps to reproduce

  1. einstein user share folder sharedWithAdmin
  2. admin user sends listShareWithMe api request
    curl -XGET -uadmin:admin https://localhost:9200/graph/v1beta1/me/drive/sharedWithMe
{
    "value": [
        {
            "@UI.Hidden": false,
            "@client.synchronize": false,
            "createdBy": {
                "user": {
                    "displayName": "Albert Einstein",
                    "id": "4c510ada-c86b-4815-8820-42cdf82c3d51"
                }
            },
            "eTag": "\"e1814f22a63e241cfc523befa7a82e07\"",
            "folder": {},
            "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!fd0ef83b-87d2-436d-8951-24dc7f57dc29:4c510ada-c86b-4815-8820-42cdf82c3d51:119ffb99-c559-4bad-acc0-b406d6c9a396",
            "lastModifiedDateTime": "2024-02-09T14:25:40.436634666+05:45",
            "name": "sharedWithAdmin",
            "parentReference": {
                "driveId": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668",
                "driveType": "virtual",
                "id": "a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668"
            },
            "remoteItem": {
                "createdBy": {
                    "user": {
                        "displayName": "Albert Einstein",
                        "id": "4c510ada-c86b-4815-8820-42cdf82c3d51"
                    }
                },
                "eTag": "\"e1814f22a63e241cfc523befa7a82e07\"",
                "folder": {},
                "id": "fd0ef83b-87d2-436d-8951-24dc7f57dc29$4c510ada-c86b-4815-8820-42cdf82c3d51!119ffb99-c559-4bad-acc0-b406d6c9a396",
                "lastModifiedDateTime": "2024-02-09T14:25:40.436634666+05:45",
                "name": "sharedWithAdmin",
                "parentReference": {
                    "driveId": "fd0ef83b-87d2-436d-8951-24dc7f57dc29$4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51",
                    "driveType": "personal"
                },
                "permissions": [
                    {
                        "grantedToV2": {
                            "user": {
                                "displayName": "Admin",
                                "id": "7fe42e72-47b7-479e-b053-640db050593e"
                            }
                        },
                        "id": "fd0ef83b-87d2-436d-8951-24dc7f57dc29:4c510ada-c86b-4815-8820-42cdf82c3d51:51191bbe-9b8f-4d70-91ae-7abfa3c9d59b",
                        "invitation": {
                            "invitedBy": {
                                "user": {
                                    "displayName": "Albert Einstein",
                                    "id": "4c510ada-c86b-4815-8820-42cdf82c3d51"
                                }
                            }
                        },
                        "roles": [
                            "fb6c3e19-e378-47e5-b277-9732f9de6e21"
                        ]
                    }
                ]
            }
        }
    ]
}
  1. admin user send propfind request on share drive
    curl -XPROPFIND -uadmin:admin https://localhost:9200/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668
    Response
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
......
    <d:response>
        <d:href>/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668/sharedWithAdmin/</d:href>
        <d:propstat>
            <d:prop>
                <oc:id>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!fd0ef83b-87d2-436d-8951-24dc7f57dc29:4c510ada-c86b-4815-8820-42cdf82c3d51:51191bbe-9b8f-4d70-91ae-7abfa3c9d59b</oc:id>
                <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!fd0ef83b-87d2-436d-8951-24dc7f57dc29:4c510ada-c86b-4815-8820-42cdf82c3d51:51191bbe-9b8f-4d70-91ae-7abfa3c9d59b</oc:fileid>
                <oc:spaceid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668</oc:spaceid>
                <oc:file-parent>fd0ef83b-87d2-436d-8951-24dc7f57dc29$4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51</oc:file-parent>
                <oc:shareid></oc:shareid>
                <oc:name>sharedWithAdmin</oc:name>
                <d:displayname>sharedWithAdmin</d:displayname>
                <d:getetag>"e1814f22a63e241cfc523befa7a82e07"</d:getetag>
                <oc:permissions>SRDNVCK</oc:permissions>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
                <oc:size>0</oc:size>
                <d:getlastmodified>Fri, 09 Feb 2024 08:40:40 GMT</d:getlastmodified>
                <oc:tags></oc:tags>
                <oc:favorite>0</oc:favorite>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop>
                <oc:audio></oc:audio>
                <oc:location></oc:location>
            </d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>
</d:multistatus>

Expected behavior

RemoteItemId should match with shared item id from propfind

Actual behavior

shared item id during propfind is different than listsharedWithme request
<oc:id>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!fd0ef83b-87d2-436d-8951-24dc7f57dc29:4c510ada-c86b-4815-8820-42cdf82c3d51:51191bbe-9b8f-4d70-91ae-7abfa3c9d59b</oc:id>
doesn't matches with

"remoteItem": {
               ......
                "id": "fd0ef83b-87d2-436d-8951-24dc7f57dc29$4c510ada-c86b-4815-8820-42cdf82c3d51!119ffb99-c559-4bad-acc0-b406d6c9a396",
}
...

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS_XXX=5.1.0-prealpha+5f57740976
OCIS_YYY=somevalue
PROXY_XXX=somevalue

Need Clarification

  • DriveItemId , PermissionId and RemoteItemId on listShareWithMe response?
  • Is DriveItemId, share-id or not?
  • Is permissionId, shared-resource-id or share-id?
  • Is RemoteItemId, shared-resource-id or resource-id ?
@rhafer
Copy link
Contributor

rhafer commented Feb 14, 2024

  • Is DriveItemId, share-id or not?

It's not the share-id. The driveItemId does currently have the resourceId of the shared resource encoded into it. But clients should never rely on that.

  • Is permissionId, shared-resource-id or share-id?

The permissionId is the shareid

  • Is RemoteItemId, shared-resource-id or resource-id ?

The id of the remoteItem is the resourceId of the shared resource.

@rhafer
Copy link
Contributor

rhafer commented Feb 15, 2024

Once we have the fix for #8080 (cs3org/reva#4517) merged and bumped in to ocis. We can adjust the sharedWithMe endpoint to return the same ids on the driveItems that are also returned by the PROPFIND on the sharejail root. 🤞

rhafer added a commit to rhafer/ocis that referenced this issue Feb 20, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Feb 20, 2024
The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: owncloud#8420
rhafer added a commit to rhafer/ocis that referenced this issue Feb 20, 2024
The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: owncloud#8420
@rhafer rhafer changed the title RemoteItemId from listSharedWithMe doesn't match with shared resource id DriveItemId from listSharedWithMe doesn't match with shared resource id Feb 20, 2024
@rhafer rhafer changed the title DriveItemId from listSharedWithMe doesn't match with shared resource id DriveItem ID from listSharedWithMe doesn't match with shared resource id Feb 20, 2024
rhafer added a commit to rhafer/ocis that referenced this issue Feb 21, 2024
The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: owncloud#8420
rhafer added a commit to rhafer/ocis that referenced this issue Feb 21, 2024
The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: owncloud#8420
rhafer added a commit to rhafer/ocis that referenced this issue Feb 21, 2024
The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: owncloud#8420
butonic pushed a commit that referenced this issue Feb 21, 2024
…FIND response (#8467)

* Bump reva

Fixes: #8080

* fix(sharing-ng): align sharedWithMe driveItem IDs

The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: #8420
@github-project-automation github-project-automation bot moved this from Prio 3 or less to Done in Infinite Scale Team Board Feb 21, 2024
ownclouders pushed a commit that referenced this issue Feb 21, 2024
…FIND response (#8467)

* Bump reva

Fixes: #8080

* fix(sharing-ng): align sharedWithMe driveItem IDs

The IDs of the driveItems returned by the 'sharedWithMe' endpoint
should match the ids returned by the webdav PROPFIND response on
the share jail.

Fixes: #8420
@micbar micbar added this to the Release 5.0.0 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants