Skip to content

fix(apps): filter autoloading registration by app type in loadApps#59679

Open
joshtrichards wants to merge 1 commit intomasterfrom
jtr/fix-loadApps-autoloader-type-inconsistency
Open

fix(apps): filter autoloading registration by app type in loadApps#59679
joshtrichards wants to merge 1 commit intomasterfrom
jtr/fix-loadApps-autoloader-type-inconsistency

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

@joshtrichards joshtrichards commented Apr 16, 2026

Summary

Make loadApps(array $types = []) apply the $types filter consistently to both code paths.

Previously, the initial autoloader-registration loop ignored $types and touched all enabled apps, while the later loadApp() loop only loaded matching app types. Since loadApp() already handles autoloader registration itself, this broad pre-registration was inconsistent with the method contract and appears redundant for filtered loads. PHP CI also passed with the $types filter applied.

Context

I couldn’t find evidence that loadApps() must pre-register autoloaders for non-target app types; loadApp() and Coordinator already register autoloading per app. At best, this looks like historical baggage rather than part of the documented contract.

To stay conservative in case there are hidden cross-app assumptions (that aren't already addressed in other ways), this change only applies the $types filter to the first loop for now, rather than removing that loop entirely.

Testing

  • PHP CI passed with the $types filter applied to the autoloader-registration loop.

Notes

  • This appears safe for both IBootstrap and non-IBootstrap apps.
  • Possible follow-up: remove the remaining redundant pre-registration loop entirely.

Checklist

AI (if applicable)

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

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards changed the title fix(apps): filter autoloading registration by app type too in loadApps refactor(apps): filter autoloading registration by app type in loadApps Apr 17, 2026
@joshtrichards joshtrichards changed the title refactor(apps): filter autoloading registration by app type in loadApps fix(apps): filter autoloading registration by app type in loadApps Apr 17, 2026
@joshtrichards joshtrichards added ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 17, 2026
@joshtrichards joshtrichards marked this pull request as ready for review April 17, 2026 12:12
@joshtrichards joshtrichards requested a review from a team as a code owner April 17, 2026 12:12
@joshtrichards joshtrichards requested review from ArtificialOwl, artonge, nfebe and salmart-dev and removed request for a team April 17, 2026 12:12
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone Apr 17, 2026
@joshtrichards joshtrichards requested a review from come-nc April 17, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews feature: apps management ♻️ 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