Skip to content

fix: restore-point false success, updater asset match, WU COM leak#815

Merged
laurentiu021 merged 1 commit into
mainfrom
feat/2d-update-comleak-restorepoint
Jun 8, 2026
Merged

fix: restore-point false success, updater asset match, WU COM leak#815
laurentiu021 merged 1 commit into
mainfrom
feat/2d-update-comleak-restorepoint

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

Round 2d of the audit — three correctness/safety fixes on the update paths.

Restore point reported false success (P1)

CreateRestorePointAsync returned true whenever the PowerShell call didn't throw. But Checkpoint-Computer fails non-terminating in common cases — notably the once-per-24h rate limit — so failures were reported as success, undermining the reversibility story. It now runs with -ErrorAction Stop and only returns true when an explicit success sentinel is emitted; otherwise it logs and returns false.

In-app updater could never find its asset (P1)

The asset matcher looked for a fixed SysManager.exe, but releases publish SysManager-v<version>.exe, so AssetUrl/AssetSize were always null. Replaced the AssetName constant with IsMainExeAsset(name) — matches the versioned exe, excludes the .sha256 companion.

Windows Update scan leaked COM objects on failure (P1)

WindowsUpdateService.ScanAsync released its COM objects only on the success path. A cancellation or MapToEntry throw mid-scan leaked them. The four releases now run in a finally block with null guards.

Tests & regression

  • UpdateServiceAssetMatchTests (unit) covers versioned-exe accept / sha256+legacy reject.
  • IntegrationTests Constants test updated to assert IsMainExeAsset (the removed AssetName const was caught by the new CI integration-compile step — the regression sweep working as intended).
  • Full-solution build clean: main + Tests + IntegrationTests + UITests. Version 1.20.2.

Round 2d of the audit — three correctness/safety fixes around update paths:

- PerformanceService.CreateRestorePointAsync returned true whenever the call did
  not throw, but Checkpoint-Computer fails non-terminating (e.g. once-per-24h
  rate limit), so silent failures were reported as success. It now forces a
  terminating error and only returns true on an explicit success sentinel.
- UpdateService matched a fixed 'SysManager.exe' asset that no release publishes
  (real name: SysManager-v<version>.exe), so AssetUrl/AssetSize were always null.
  Replaced with IsMainExeAsset (versioned exe, excludes the .sha256 companion).
- WindowsUpdateService.ScanAsync released COM objects only on the happy path,
  leaking them when cancellation/mapping threw mid-scan. Releases moved to finally.

Tests: UpdateServiceAssetMatchTests (unit) + updated IntegrationTests Constants
test now asserts IsMainExeAsset instead of the removed AssetName const. Full
solution regression build clean across all four projects.
@laurentiu021 laurentiu021 merged commit dc374a4 into main Jun 8, 2026
4 checks passed
@laurentiu021 laurentiu021 deleted the feat/2d-update-comleak-restorepoint branch June 8, 2026 11:50
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