Skip to content

fix: move/copy to share subfolder fails with PROPFIND 404 (regression from v4→v7) #3483

Description

@IronWERTY

Description

Moving or copying a file to a subfolder within a received share fails with two PROPFIND 404 errors:

PROPFIND https:///dav/spaces/k2 → 404
PROPFIND https:///dav/spaces/f1/k2 → 404

Moving to the share root works correctly. Moving to subfolders is broken.

Root Cause

In useGetMatchingSpace.ts, getMatchingSpace() uses resource.storageId to find
the matching space. For a subfolder inside a share, storageId is derived as
storageID$spaceID (by splitting fileId on !). However, the share space has
id = storageID$spaceID!rootNodeID — so the lookup never matches.

The fallback then creates a broken share space with id = undefined
(because resource.remoteItemId is not set for subfolders), resulting in
webDavPath = '/spaces' and destination URL /dav/spaces/<folderName>.

Fix

This was already fixed in owncloud/web:

The fix changes one line in packages/web-pkg/src/composables/spaces/useGetMatchingSpace.ts:

- let storageId = resource.storageId
+ let storageId = resource.spaceId
(plus adds SpaceId DAV property and populates resource.spaceId in buildResource)

Steps to Reproduce

1. User A shares folder f1 (which contains subfolder k2) with User B
2. User B opens the share, selects a file inside f1/k2/j1/
3. User B tries to move the file to k2 → fails with PROPFIND 404

Version

OpenCloud 7.2.4 (regression introduced in v4→v7 upgrade, worked in v4.0.6)

Activity

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