Refactor EnabledSourceHandler into three separate classes with clear duties

Created on 18 July 2025, 5 days ago

Problem/Motivation

As I pointed out in #3536664-6: Data cached by EnabledSourceHandler never expires β†’ , EnabledSourceHandler is hard to understand and maintain because it combines several distinct responsibilities in ways, massively violating the single-responsibility principle.

It has three purposes:

  1. Filter out enabled source plugins
  2. Handle querying and caching those queries
  3. Storing project data permanently

Each of these needs to be a separate class; EnabledSourceHandler should probably be removed. It is internal, so we have latitude to remove it without breaking our backwards-compatibility promise.

Proposed resolution

Split EnabledSourceHandler into three classes:

  • QueryManager: handles querying and query caching
  • ProjectRepository: acts as a permanent store for Project objects, that gets updated on a rolling basis as queries return new data, and can only be cleared by an explicit command-line action
  • ProjectBrowserSourceManager: Already exists, but the functionality of getCurrentSources() should be moved into it as a new getAllEnabledSources() method.
πŸ“Œ Task
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
  • API clean-up

    Refactors an existing API or subsystem for consistency, performance, modularization, flexibility, third-party integration, etc. May imply an API change. Frequently used during the Code Slush phase of the release cycle.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024