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

OCS receiving multiple shares from the same source #8080

Closed
fschade opened this issue Dec 28, 2023 · 4 comments
Closed

OCS receiving multiple shares from the same source #8080

fschade opened this issue Dec 28, 2023 · 4 comments
Assignees
Labels

Comments

@fschade
Copy link
Contributor

fschade commented Dec 28, 2023

Describe the bug

receiving the same resource multiple times leads to a propfind which contains the same item multiple times

Steps to reproduce

  1. create a folder A (all from the web ui)
  2. share the A folder to marie
  3. share the A folder to physics lovers
  4. send a propfind (as marie) to the share jail, e.g. https://srV.tld/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%21a0ca6a90-a365-4782-871e-d44447bbc668/</d:href>
        <d:propstat>
            <d:prop>
                <oc:id>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668</oc:id>
                <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668</oc:fileid>
                <oc:spaceid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668</oc:spaceid>
                <oc:shareid>a0ca6a90-a365-4782-871e-d44447bbc668</oc:shareid>
                <d:getetag>"3e93733606de3918147ed0794c831af4"</d:getetag>
                <oc:permissions></oc:permissions>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
                <oc:size>0</oc:size>
                <d:getlastmodified>Thu, 28 Dec 2023 09:38:47 GMT</d:getlastmodified>
                <oc:favorite>0</oc:favorite>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
        <d:propstat>
            <d:prop>
                <oc:file-parent></oc:file-parent>
            </d:prop>
            <d:status>HTTP/1.1 404 Not Found</d:status>
        </d:propstat>
    </d:response>
    <d:response>
        <d:href>/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%21a0ca6a90-a365-4782-871e-d44447bbc668/A/</d:href>
        <d:propstat>
            <d:prop>
                <oc:id>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!ce2ad9db-a9c1-4916-8bb5-a3e4b7a65dff:05e3db26-be0e-48a8-ba47-81e3a5cf504b:40ddbf9d-2bd1-4ef2-91b0-6eac1c30b68f</oc:id>
                <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!ce2ad9db-a9c1-4916-8bb5-a3e4b7a65dff:05e3db26-be0e-48a8-ba47-81e3a5cf504b:40ddbf9d-2bd1-4ef2-91b0-6eac1c30b68f</oc:fileid>
                <oc:spaceid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668</oc:spaceid>
                <oc:file-parent>ce2ad9db-a9c1-4916-8bb5-a3e4b7a65dff$05e3db26-be0e-48a8-ba47-81e3a5cf504b!05e3db26-be0e-48a8-ba47-81e3a5cf504b</oc:file-parent>
                <oc:shareid>a0ca6a90-a365-4782-871e-d44447bbc668</oc:shareid>
                <oc:name>A</oc:name>
                <d:displayname>A</d:displayname>
                <d:getetag>"3e93733606de3918147ed0794c831af4"</d:getetag>
                <oc:permissions>SR</oc:permissions>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
                <oc:size>0</oc:size>
                <d:getlastmodified>Thu, 28 Dec 2023 09:38:47 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:response>
        <d:href>/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%21a0ca6a90-a365-4782-871e-d44447bbc668/A/</d:href>
        <d:propstat>
            <d:prop>
                <oc:id>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!ce2ad9db-a9c1-4916-8bb5-a3e4b7a65dff:05e3db26-be0e-48a8-ba47-81e3a5cf504b:86c9bae2-151d-450c-93c3-fb94f04d181e</oc:id>
                <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!ce2ad9db-a9c1-4916-8bb5-a3e4b7a65dff:05e3db26-be0e-48a8-ba47-81e3a5cf504b:86c9bae2-151d-450c-93c3-fb94f04d181e</oc:fileid>
                <oc:spaceid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668</oc:spaceid>
                <oc:file-parent>ce2ad9db-a9c1-4916-8bb5-a3e4b7a65dff$05e3db26-be0e-48a8-ba47-81e3a5cf504b!05e3db26-be0e-48a8-ba47-81e3a5cf504b</oc:file-parent>
                <oc:shareid>a0ca6a90-a365-4782-871e-d44447bbc668</oc:shareid>
                <oc:name>A</oc:name>
                <d:displayname>A</d:displayname>
                <d:getetag>"3e93733606de3918147ed0794c831af4"</d:getetag>
                <oc:permissions>SR</oc:permissions>
                <d:resourcetype>
                    <d:collection/>
                </d:resourcetype>
                <oc:size>0</oc:size>
                <d:getlastmodified>Thu, 28 Dec 2023 09:38:47 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

implicit href de-duplication

  • /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%21a0ca6a90-a365-4782-871e-d44447bbc668/A-1/
  • /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%21a0ca6a90-a365-4782-871e-d44447bbc668/A-2/

Actual behavior

duplicated name

  • /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%21a0ca6a90-a365-4782-871e-d44447bbc668/A/
  • /dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%21a0ca6a90-a365-4782-871e-d44447bbc668/A/
@individual-it
Copy link
Member

disabling sync will make one of the resources disappear, but not both. See #8232

@micbar
Copy link
Contributor

micbar commented Jan 17, 2024

This seems to be a bug during auto accept.

before the auto accept it was deduplicating the resources when accepting.

@butonic @aduffeck @kobergj needs a bugfix.

@rhafer
Copy link
Contributor

rhafer commented Feb 13, 2024

I came across this when looking into #8420.

I don't think this is related auto-accept in any way. It's the same behavior in stable-4.0 which does not have the auto-accept feature.
Also issue this is about receiving the same shared item twice (via direct and group share). AFAICT we should not de-duplicate the shares by giving them different names in this case. If any we should collapse both shares into a single <prop>.

The deduplication of the names is only needed when receiving shares for different items that have the same name. That still works as expected.

@individual-it
Copy link
Member

agree, issue will be same if done by auto-accept or manual accept
also agree on the naming, if its actually the same resource it should be visible only once by webDAV PROPFIND

@rhafer rhafer self-assigned this Feb 14, 2024
rhafer added a commit to rhafer/reva that referenced this issue Feb 15, 2024
When listing the sharejail root, merge shares that target the same resource
into a single resource. In order to avoid the resourceId changing randomly the
id will be composed from the oldest accepted share that exist for the resource.

Ideally we'd compose the resourceId based on the id of the shared resource, but
that is currently not possible in a backwards compatible way. Some clients seem
to rely on the fact that the resource ids in the sharejail contain valid shareids.

Fixes: owncloud/ocis#8080
rhafer added a commit to rhafer/reva that referenced this issue Feb 15, 2024
When listing the sharejail root, merge shares that target the same resource
into a single resource. In order to avoid the resourceId changing randomly the
id will be composed from the oldest accepted share that exist for the resource.

Ideally we'd compose the resourceId based on the id of the shared resource, but
that is currently not possible in a backwards compatible way. Some clients seem
to rely on the fact that the resource ids in the sharejail contain valid shareids.

Fixes: owncloud/ocis#8080
rhafer added a commit to rhafer/reva that referenced this issue Feb 15, 2024
When listing the sharejail root, merge shares that target the same resource
into a single resource. In order to avoid the resourceId changing randomly the
id will be composed from the oldest accepted share that exist for the resource.

Ideally we'd compose the resourceId based on the id of the shared resource, but
that is currently not possible in a backwards compatible way. Some clients seem
to rely on the fact that the resource ids in the sharejail contain valid shareids.

Fixes: owncloud/ocis#8080
rhafer added a commit to rhafer/ocis that referenced this issue Feb 15, 2024
rhafer added a commit to rhafer/reva that referenced this issue Feb 20, 2024
When listing the sharejail root, merge shares that target the same resource
into a single resource. In order to avoid the resourceId changing randomly the
id will be composed from the oldest accepted share that exist for the resource.

Ideally we'd compose the resourceId based on the id of the shared resource, but
that is currently not possible in a backwards compatible way. Some clients seem
to rely on the fact that the resource ids in the sharejail contain valid shareids.

Fixes: owncloud/ocis#8080
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
rhafer added a commit to rhafer/reva that referenced this issue Feb 20, 2024
When listing the sharejail root, merge shares that target the same resource
into a single resource. In order to avoid the resourceId changing randomly the
id will be composed from the oldest accepted share that exist for the resource.

Ideally we'd compose the resourceId based on the id of the shared resource, but
that is currently not possible in a backwards compatible way. Some clients seem
to rely on the fact that the resource ids in the sharejail contain valid shareids.

Fixes: owncloud/ocis#8080
rhafer added a commit to rhafer/ocis that referenced this issue Feb 20, 2024
rhafer added a commit to rhafer/reva that referenced this issue Feb 21, 2024
When listing the sharejail root, merge shares that target the same resource
into a single resource. In order to avoid the resourceId changing randomly the
id will be composed from the oldest accepted share that exist for the resource.

Ideally we'd compose the resourceId based on the id of the shared resource, but
that is currently not possible in a backwards compatible way. Some clients seem
to rely on the fact that the resource ids in the sharejail contain valid shareids.

Fixes: owncloud/ocis#8080
rhafer added a commit to rhafer/ocis that referenced this issue Feb 21, 2024
rhafer added a commit to rhafer/ocis that referenced this issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants