Moving a Workspace Folder Leaves Descendants at Their Old Paths
Level 3 · node · Data · Missing descendant path synchronization during hierarchical moves
Scenario
A collaborative document workspace stores fullPath on each folder for fast browsing. After an administrator moves a project folder containing nested folders under another parent, the moved folder appears in the new location, but its descendants remain searchable at the old paths. Trace the folder service and repository to restore consistent paths across the entire subtree.
Requirements
- Update the moved folder's parentId and fullPath. - Update every descendant folder's fullPath to use the new path prefix. - Handle both direct children and deeper descendants. - Leave unrelated sibling folders unchanged. - Return 404 when the moved folder or destination parent does not exist. - Return success and the new path for a valid move.
Acceptance criteria
- The moved folder has the destination parent identifier and full path
- Direct children receive the new full-path prefix after moving
- Grandchildren and deeper descendants also receive the new prefix
- Sibling folders outside the moved subtree keep their paths and parents
- Moving a nonexistent folder returns a 404 response
- A successful response contains the moved folder's new full path