Skip to content

fix(themes-catalog): rebuild themes.json from scratch on each reconfi… - #21

Merged
ralflang merged 1 commit into
horde:FRAMEWORK_6_0from
jcdelepine:fix/themes-catalog
Jul 2, 2026
Merged

ralflang merged 1 commit into
horde:FRAMEWORK_6_0from
jcdelepine:fix/themes-catalog

Conversation

@jcdelepine

Copy link
Copy Markdown

Problem

themes.json accumulates stale entries for themes/apps that have been
removed from disk (theme subdir deleted, or theme package uninstalled).
ThemesCatalog::register() only adds/overwrites entries, never prunes
them, and unregister() is a no-op stub never called with a specific
package. Result: setupPackagedThemes() keeps recreating dead symlinks
that DeadSymlinkCleaner just removed on the same run.

Fix

HordeReconfigureFlow::run() already computes the authoritative list
of installed theme packages via InstalledVersions::getInstalledPackagesByType('horde-theme')
on every run. Add ThemesCatalog::reset() and call it before the
register 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.json and web/themes/ stay in sync, no dead symlinks.

…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
ralflang self-requested a review July 2, 2026 16:28
@ralflang
ralflang merged commit fbfe58d into horde:FRAMEWORK_6_0 Jul 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants