Skip to content

fix: handle Storage-WMI COM errors, dispose explorer handle, log swallowed exceptions#877

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/error-handling-logging
Jun 12, 2026
Merged

fix: handle Storage-WMI COM errors, dispose explorer handle, log swallowed exceptions#877
laurentiu021 merged 1 commit into
mainfrom
fix/error-handling-logging

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

Summary

Error-handling and reliability batch from the audit: missing COM-error handlers, a leaked
process handle, and several silent catch blocks that now log.

Fixes

  • DiskHealthService / SystemInfoService — the Storage-namespace WMI query caught
    ManagementException / UnauthorizedAccessException but not the COMException that
    scope.Connect() throws when root\Microsoft\Windows\Storage is absent (older/headless
    Windows). DiskHealth now catches it (returns what it has); SystemInfo routes it to the
    existing Win32_DiskDrive fallback. Mirrors the FixedDriveService fix shipped earlier.
  • ProcessManagerService.OpenFileLocationProcess.Start(...) returned a Process
    handle that was discarded undisposed (same leak class as the AdminHelper fix). Now ?.Dispose()d.
  • Logging on swallowed exceptions (Debug level, full exception):
    • UpdateService.CleanupFile — empty IOException/UnauthorizedAccessException catches.
    • DeepCleanupService — silent inline directory-delete catches.
    • WindowsUpdateService.MapToEntry — empty COM/RuntimeBinder catches on size extraction.
    • DashboardViewModel polling loop — logged ex.Message only → now logs the full exception.

Verification

  • Build: main + Tests 0 warnings / 0 errors.
  • Used Serilog.Log (fully-qualified) in UpdateService and WindowsUpdateService, where
    Log is otherwise taken (an event Action<string>? Log in the latter) — verified against
    each file's existing logging style.

fix: → patch release (1.20.22). Protocol C to follow.

@laurentiu021 laurentiu021 merged commit 2632590 into main Jun 12, 2026
4 checks passed
@laurentiu021 laurentiu021 deleted the fix/error-handling-logging branch June 12, 2026 14:58
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