Skip to content

fix: recover saved-rule monitoring after sleep (v1.7.9) - #96

Merged
PrimeBuild-pc merged 4 commits into
mainfrom
fix/persistent-rule-path-retry
Nov 11, 2026
Merged

PrimeBuild-pc merged 4 commits into
mainfrom
fix/persistent-rule-path-retry

Conversation

@PrimeBuild-pc

@PrimeBuild-pc PrimeBuild-pc commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Related to #95. Keep the issue open until the reporter confirms recovery after sleep.

app startup / manual Start -> enable monitoring -> subscribe -> snapshot -> evaluate saved rules
resume / unlock / watcher Stopped / watchdog -> renew subscriptions -> snapshot -> same rule evaluation
WMI unavailable -> optional polling + independent WMI retry with backoff

Sleep could leave WMI subscriptions silent while monitoring still reported active. Previously only active fallback polling retried WMI; there was no resume subscription, silence watchdog or rescan on WMI recovery. The startup snapshot also preceded watcher creation, leaving a gap for processes launched between those operations. Executable-path retries and early diagnostic initialization from the existing branch are included.

Automatic and manual startup already shared StartAsync() and its initial rule evaluation. App startup now uses the exact manual enable entry point too. The report alone cannot establish why restarting the app was ineffective on the affected machine: a new app process cannot repair Windows WMI provider readiness, and a one-time scan can still encounter temporarily unavailable paths. The patch covers those failure modes without claiming to have reproduced the reporter's full Windows sleep sequence.

Evidence

  • Before: both resume and watcher-Stopped regression cases timed out: 0 passed, 2 failed.
  • After: 939 tests passed; Release solution build succeeded. Tests cover subscription renewal and rescan, existing-process rule evaluation on both startup paths, the startup subscription gap, silent watchers, fallback polling, retry backoff, retired callbacks and Stop during recovery.
  • Resume was simulated through the wake event handler. Hyper-V access and a native WMI smoke attempt were denied in the non-elevated session; no VM state or checkpoint was changed.
  • Version, installer/build defaults, Chocolatey metadata, changelog and release notes are aligned to v1.7.9.

Merge Danger

Door: two-way

Blast Radius: monitoring

Changes are scoped to saved-rule process discovery/recovery and release metadata. Recovery respects monitoring and fallback settings, serializes with Start/Stop, resets rule cooldowns for a fresh startup/recovery scan, and records diagnostics.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-11T14:04:39.301413Z
We couldn’t complete this review. Comment @codex review to try again.
ea1425b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Renew WMI subscriptions and rescan running processes after resume, unlock, stopped subscriptions or prolonged event silence. Keep WMI retries independent of fallback polling and serialize recovery with Start/Stop.

Subscribe before the initial snapshot to cover processes started during watcher setup. Route app startup through the manual enable path and prepare v1.7.9 metadata.
Reset per-process duplicate suppression before the shared startup and recovery snapshot evaluation so a short sleep cannot suppress rule reapplication.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 63.69231% with 118 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
Services/ProcessMonitorService.cs 61.07% 56 Missing and 9 partials ⚠️
Services/ProcessMonitoringEvents.cs 15.78% 32 Missing ⚠️
Services/PersistentRuleAutoApplyService.cs 84.44% 8 Missing and 6 partials ⚠️
Services/ProcessMonitorManagerService.cs 76.92% 5 Missing and 1 partial ⚠️
MainWindow.Behaviors.partial.cs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@PrimeBuild-pc
PrimeBuild-pc merged commit 03872a3 into main Nov 11, 2026
3 checks passed
@PrimeBuild-pc
PrimeBuild-pc deleted the fix/persistent-rule-path-retry branch November 11, 2026 14:12
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.

2 participants