Skip to content

refactor(files): reduce duplication in node copy/move and tidy Node internals#60971

Draft
joshtrichards wants to merge 5 commits into
masterfrom
jtr/refactor-Node-copyAndMove
Draft

refactor(files): reduce duplication in node copy/move and tidy Node internals#60971
joshtrichards wants to merge 5 commits into
masterfrom
jtr/refactor-Node-copyAndMove

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

@joshtrichards joshtrichards commented Jun 3, 2026

Summary

Clean up OC\Files\Node\Node by extracting shared copy/move target-path logic, isolating move-specific cache updates, and simplifying related property/docblock structure.

Changes

For copy() / move():

  • more precise variable naming
  • extract common copy/move target preparation into prepareTargetPath()
  • move cached file info refresh after rename into updateCachedFileInfoAfterMove()
  • keep copy() / move() focused on operation-specific behavior and hooks
  • retain special handling for movable root mount targets during move()
  • distinct messaging for different NotPermittedException scenarios

Misc:

  • convert root and view to promoted properties
  • remove redundant/inherited docblocks in Node
  • add @internal annotations to getFileInfo() and isValidPath()
  • add missing @throws documentation for OCP\Files\Node::copy()

Notes

This reduces duplication in copy/move handling, makes the control flow in Node easier to follow, and cleans up surrounding type/documentation noise without intending to change behavior.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

- Substantive changes are in copy() and move()
- Other changes are unrelated modernization (constructor property promotion + elimination of outdated docblocks for functions already covered in interfaces)


Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
+Clearer variable naming
+Clear delineate NotPermissionException failure modes

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Jun 3, 2026
@joshtrichards joshtrichards added 2. developing Work in progress feature: filesystem feature: files technical debt 🧱 🤔🚀 ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Jun 3, 2026
Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress feature: files feature: filesystem ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant