Skip to content

refactor: drop two orphan DI registrations for static-only services#854

Merged
laurentiu021 merged 1 commit into
mainfrom
refactor/r5-drop-orphan-di-registrations
Jun 11, 2026
Merged

refactor: drop two orphan DI registrations for static-only services#854
laurentiu021 merged 1 commit into
mainfrom
refactor/r5-drop-orphan-di-registrations

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

Summary

Removes two dead DI registrations. IconExtractorService and ServiceManagerService
expose only static members and every call site is a static call — the container
constructed an unused empty singleton of each at startup that nothing ever resolved.
Deleting the registrations removes that dead wiring without touching any call site.

Changes

ServiceRegistration.cs:

  • Removed services.AddSingleton<IconExtractorService>();
  • Removed services.AddSingleton<ServiceManagerService>();

Both classes remain exactly as-is (static utility classes); all static call sites are
untouched.

Why this is safe / behavior-identical

  • Verified neither type is ever resolved from the container
    (GetService/GetRequiredService) or constructor-injected anywhere — both are
    pure static-method utilities. The build proves there is no compile-time dependency.
  • No test (unit or integration) asserts these registrations exist.
  • The only runtime effect was the container eagerly new-ing one unused instance of
    each on first build of the provider; nothing read those instances, so removing them
    changes no observable behavior.

Note: AppBlockerService — flagged alongside these in the original audit — is not
an orphan anymore; it was converted to an injected instance behind IAppBlockerService
in an earlier PR and is correctly registered. Left untouched.

Verification

  • Build: main + Tests + IntegrationTests all 0 warnings / 0 errors.

Behavior identical (Protocol Q). refactor: → no release.

@laurentiu021 laurentiu021 merged commit 29006f6 into main Jun 11, 2026
4 checks passed
@laurentiu021 laurentiu021 deleted the refactor/r5-drop-orphan-di-registrations branch June 11, 2026 13:19
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.

1 participant