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)
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()usesresource.storageIdto findthe matching space. For a subfolder inside a share,
storageIdis derived asstorageID$spaceID(by splittingfileIdon!). However, the share space hasid = storageID$spaceID!rootNodeID— so the lookup never matches.The fallback then creates a broken share space with
id = undefined(because
resource.remoteItemIdis not set for subfolders), resulting inwebDavPath = '/spaces'and destination URL/dav/spaces/<folderName>.Fix
This was already fixed in owncloud/web:
use spaceId instead of storageId in getMatchingSpaceThe fix changes one line in
packages/web-pkg/src/composables/spaces/useGetMatchingSpace.ts: