Skip to content

[Sharing NG] sharedByMe endpoint is missing data for drives shared via link #8355

Closed

Description

@JammingBen

Describe the bug

The sharedByMe endpoint is missing data (name, parent name and path) for drives that are shared via link.

Steps to reproduce

  1. Create a drive
  2. Share it via link
  3. Fetch all drive items that have been shared by you via the sharedByMe endpoint and have a look at the response

Expected behavior

The response for drives is comparable to the one for regular resources.

Actual behavior

The name of the drive item and the name and path of the parentReference are ".".

@rhafer Not 100% about the expected behaviour, but that's how the OCS api behaved at least.

Activity

  1. JammingBen commented on May 14, 2024

    @JammingBen
    ContributorAuthor

    I'm still having the same issue. Did you make sure to share a drive (space)? Note that Web is using the root endpoint for creating links for drives, maybe there is still some issue: https://localhost:9200/graph/v1beta1/drives/{drive-id}/root/createLink

  2. saw-jan commented on May 14, 2024

    @saw-jan
    Member

    Here's what I did:

    1. Create a space: myspace (webUI)
    2. Create a link share of that space (webUI)
    POST: https://localhost:9200/graph/v1beta1/drives/9f8c2d70-780a-4383-a3b2-fb4310c18076%2426664ea7-1276-4da1-8b0b-685e72f5abc7/root/createLink
    Request body: {"type":"view","@libre.graph.quickLink":false,"password":"^_ZzqA92j[dB","displayName":"Link"}
    1. Get sharedByMe list (webUI/curl)
    GET: https://localhost:9200/graph/v1beta1/me/drive/sharedByMe
    
    Response:
    {
        "value": [
            {
                "eTag": "\"db7600305c28bd3a15fda7a574f4a587\"",
                "folder": {},
                "id": "9f8c2d70-780a-4383-a3b2-fb4310c18076$26664ea7-1276-4da1-8b0b-685e72f5abc7!26664ea7-1276-4da1-8b0b-685e72f5abc7",
                "lastModifiedDateTime": "2024-05-14T14:31:16.357338399+05:45",
                "name": ".",
                "parentReference": {
                    "driveId": "9f8c2d70-780a-4383-a3b2-fb4310c18076$26664ea7-1276-4da1-8b0b-685e72f5abc7",
                    "driveType": "project",
                    "id": "9f8c2d70-780a-4383-a3b2-fb4310c18076$26664ea7-1276-4da1-8b0b-685e72f5abc7",
                    "name": ".",
                    "path": "."
                },
                "permissions": [
                    {
                        "createdDateTime": "2024-05-14T08:48:05.427255127Z",
                        "hasPassword": true,
                        "id": "htsWTzbJQPShNVP",
                        "link": {
                            "@libre.graph.displayName": "Link",
                            "@libre.graph.quickLink": false,
                            "preventsDownload": false,
                            "type": "view",
                            "webUrl": "https://localhost:9200/s/BanbILqvlzyRGSL"
                        }
                    }
                ],
                "size": 47279
            }
        ]
    }

    The response has the link share but I don't see anything in the UI. Or is it not the response you are expecting?
    Maybe the problem is with name, parentReference.name or parentReference.path properties. 🤔

    Here is the response of sharedByMe of the resource share:

    {
        "value": [
            {
                "eTag": "\"dfe6c905b07c54104a3c5b33e23f2e41\"",
                "folder": {},
                "id": "9f8c2d70-780a-4383-a3b2-fb4310c18076$bd767495-5e57-417f-a0a7-402ca1ea5051!4901b71a-1936-4dae-b382-eea149576772",
                "lastModifiedDateTime": "2024-05-14T14:39:54.008234717+05:45",
                "name": "New folder",
                "parentReference": {
                    "driveId": "9f8c2d70-780a-4383-a3b2-fb4310c18076$bd767495-5e57-417f-a0a7-402ca1ea5051",
                    "driveType": "personal",
                    "id": "9f8c2d70-780a-4383-a3b2-fb4310c18076$bd767495-5e57-417f-a0a7-402ca1ea5051!bd767495-5e57-417f-a0a7-402ca1ea5051",
                    "name": "/",
                    "path": "/"
                },
                "permissions": [
                    {
                        "createdDateTime": "2024-05-14T08:54:58.723671364Z",
                        "hasPassword": true,
                        "id": "LWBaTydejpVdEEM",
                        "link": {
                            "@libre.graph.displayName": "Link",
                            "@libre.graph.quickLink": false,
                            "preventsDownload": false,
                            "type": "view",
                            "webUrl": "https://localhost:9200/s/HjFXcSVIInxucHa"
                        }
                    }
                ],
                "size": 0
            }
        ]
    }
  3. saw-jan commented on May 14, 2024

    @saw-jan
    Member

    Similar with permissions endpoint: v1beta1/drives/{drive-id}/items/{drive-root-path-id}/createLink
    ocis version: Infinite Scale 5.1.0-prealpha+35f3018d11 Community

  4. JammingBen commented on May 14, 2024

    @JammingBen
    ContributorAuthor

    As discussed in chat, you're right, I overlooked it 🤦 Gonna check later why Web is not displaying the resource.

    The name "." is still wrong of course, so that parts needs a fix on the server side.

  5. changed the title [-][Sharing NG] sharedByMe endpoint is missing drives that are shared via link[/-] [+][Sharing NG] sharedByMe endpoint is missing data for drives shared via link[/+] on May 14, 2024
  6. JammingBen commented on May 14, 2024

    @JammingBen
    ContributorAuthor

    Okay so it seems that "." is also the issue why Web doesn't list the drives. I adjusted the title and the description of the issue.

  7. rhafer commented on May 14, 2024

    @rhafer
    Contributor

    Hm, we're just returning what the CS3 API is providing us. So the name property is just populated with the base part ResourceInfo's path property.

    For spaceroots that is . as the spaceroot does not really have a (file- or directory-)name I think. I guess you'd expect the space's name to appear there? I guess we could add a special case here for spaceroots. But it feels wrong at least in some ways. AFAIK the name property is supposed to be a file or directory name (the name of a space is neither of that).

    @butonic Any suggestion how a space root is properly represented as a driveItem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions