Skip to content

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Dec 19, 2025

This PR introduces less implementation changes than it may appear. Most of the diff is due to formatting changes, variable renaming, and factoring existing code into new private methods.

The overall goal:
Refactor code for better readability and future maintainability.

Key areas of change

  • Code formatting improvements
  • Variable renaming for clarity
  • Addition and clean-up of comments
  • Refactoring lengthy callbacks into private methods
  • Minor modernization and readability tweaks (no fundamental logic changes)

Details by Component

RootCollection

  • Added class-level docblock
  • Updated outdated docblocks
  • Improved error messaging

PropFindPlugin

  • Added class-level docblock
  • Made DI properties readonly
  • Moved user session property initialization from constructor to initialize() for Sabre plugin consistency
  • Refactored MOUNT_POINT_PROPERTYNAME logic into a private method
  • Added inline comments

GroupFoldersHome

  • Added class-level docblock
  • Improved consistency and usefulness of error messages
  • Added parameter type hints
  • Ordered private methods after public/interface methods
  • Reformatted code
  • Added docblocks to private methods

GroupFolderNode

  • Added class-level docblock

ACLPlugin

  • Added class-level docblock
  • Renamed variables for clarity
  • Added inline comments to clarify logic
  • Ordered private methods after public/interface methods
  • Reformatted code
  • Added docblocks to property request/update handler implementations
  • Moved lengthy property-specific handlers to private methods
  • Added docblocks to private methods

Other:

  • Updated stubs to include the getDirectDownloadById() method recently added in Server, fixing failing tests

TODO:

@joshtrichards joshtrichards changed the title refactor(dav): improve code readability / ease future maintenance [WIP] refactor(dav): improve code readability / ease future maintenance Dec 19, 2025
@joshtrichards joshtrichards force-pushed the jtr/dav-small-refactors branch 2 times, most recently from daa3f5f to 4917721 Compare December 24, 2025 18:06
…rs, simplify code, and improve docs

Improved readability and maintainability: added type hints, made error messages consistent, simplified code by removing unnecessary storage checks and redundant logic, clarified documentation, and aligned implementation with Nextcloud conventions.



Signed-off-by: Josh <[email protected]>
- Minor docblock imporvements
- Extract mount path calculation to dedicated method

Signed-off-by: Josh <[email protected]>
Added TODO comments to log silent edge cases

Signed-off-by: Josh <[email protected]>
Refactor user property to be readonly and initialize in constructor.

Signed-off-by: Josh <[email protected]>
And update variable names for clarity and consistency throughout.

Signed-off-by: Josh <[email protected]>
moved details to private method docblocks

Signed-off-by: Josh <[email protected]>
@joshtrichards joshtrichards force-pushed the jtr/dav-small-refactors branch from 4917721 to a0c1dab Compare December 24, 2025 18:06
@joshtrichards joshtrichards changed the title [WIP] refactor(dav): improve code readability / ease future maintenance refactor(dav): improve code readability / maintainability Dec 24, 2025
@joshtrichards joshtrichards marked this pull request as ready for review December 24, 2025 18:36
@joshtrichards joshtrichards added this to the Nextcloud 33 milestone Dec 24, 2025
@joshtrichards joshtrichards changed the title refactor(dav): improve code readability / maintainability refactor(dav): readability improvements Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Items that need to be reviewed enhancement technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants