Skip to content

fix: keep transient WMI failures in the tray timer from crashing the app#929

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/p2-tray-wmi-crash
Jun 17, 2026
Merged

fix: keep transient WMI failures in the tray timer from crashing the app#929
laurentiu021 merged 1 commit into
mainfrom
fix/p2-tray-wmi-crash

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

The system-tray tooltip refreshes CPU/RAM/uptime on a background timer. OnTimerTick is async void, and UpdateTooltipAsyncSystemInfoService.CaptureAsync() runs WMI queries. WMI commonly throws COMException on transient faults (RPC server unavailable 0x800706BA, repository errors), which UpdateTooltipAsync did NOT catch — so it escaped the async-void handler and crashed the whole app.

Changes (TrayIconService)

  • Added a catch (COMException) arm to UpdateTooltipAsync (logs the HRESULT, skips the tick), alongside the existing ManagementException/InvalidOperationException catches.
  • Added a final last-resort catch (Exception) to OnTimerTick (logged) — an async-void background poller must never let anything escape and take the process down.

Build: 0 warnings / 0 errors. Version 1.20.39. (Stacks on #927; will rebase to final version before merge.)

@laurentiu021 laurentiu021 force-pushed the fix/p2-tray-wmi-crash branch from 7d05496 to b9891b7 Compare June 17, 2026 16:31
@laurentiu021 laurentiu021 merged commit c27f43b into main Jun 17, 2026
4 checks passed
@laurentiu021 laurentiu021 deleted the fix/p2-tray-wmi-crash branch June 17, 2026 16:39
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