Repository navigation
fix(themes-catalog): rebuild themes.json from scratch on each reconfi… - #21
Merged
Merged
Conversation
…gure run ThemesCatalog::register() was purely additive: entries for themes/apps no longer present on disk were never removed, causing DeadSymlinkCleaner to repeatedly clean up stale symlinks that setupPackagedThemes() would then recreate from the stale catalog on the next run. Add ThemesCatalog::reset() and call it in HordeReconfigureFlow::run() before re-registering all currently installed horde-theme packages, so themes.json reflects only the current install state.
ralflang
self-requested a review
July 2, 2026 16:28
ralflang
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
themes.jsonaccumulates stale entries for themes/apps that have beenremoved from disk (theme subdir deleted, or theme package uninstalled).
ThemesCatalog::register()only adds/overwrites entries, never prunesthem, and
unregister()is a no-op stub never called with a specificpackage. Result:
setupPackagedThemes()keeps recreating dead symlinksthat
DeadSymlinkCleanerjust removed on the same run.Fix
HordeReconfigureFlow::run()already computes the authoritative listof installed theme packages via
InstalledVersions::getInstalledPackagesByType('horde-theme')on every run. Add
ThemesCatalog::reset()and call it before theregister loop, so the catalog is rebuilt from scratch instead of
accreting stale state.
Testing
Reproduced with a theme package whose app subdir was removed.
Before: symlink recreated every run despite DeadSymlinkCleaner.
After:
themes.jsonandweb/themes/stay in sync, no dead symlinks.