Harden tunnel cleanup and legacy migration#113
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors configuration validation into a dedicated ConfigValueValidator class, enhances the legacy profile migration process with size limits and reparse-point checks, improves process list inspection robustness, and refactors timed-out connection cleanup handling in the main form. The review feedback suggests optimizing string trimming in ConfigValueValidator.IsBool and ConfigValueValidator.IsOneOf to avoid redundant allocations during frequent syntax highlighting updates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR hardens tunnel shutdown/timeout cleanup paths and legacy profile migration, while improving reliability of process enumeration and factoring editor config validation into a shared helper.
Changes:
- Harden legacy profile migration by copying into a bounded temporary file, rejecting reparse-point sources via handle inspection, and enforcing a 1 MiB migration limit.
- Prevent re-activation during timed-out connect cleanup; add late-cleanup network-lock reset logic for shutdown/cleanup failures.
- Isolate per-process inspection failures during process enumeration and extract editor scalar validation into
ConfigValueValidatorwith updated tests/docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WireSockUI/Program.cs | Adds secure, size-bounded legacy profile migration using handle-based reparse checks and temp-file staging. |
| WireSockUI/Native/ProcessList.cs | Catches per-process inspection failures so one bad process doesn’t break enumeration. |
| WireSockUI/Forms/frmMain.cs | Disables activation during timed-out connect cleanup; improves shutdown timeout handling and network-lock reset behavior. |
| WireSockUI/Forms/frmEdit.cs | Switches editor validation to shared ConfigValueValidator helpers. |
| WireSockUI/Config/ConfigValueValidator.cs | New shared validator for numeric/bool/enum-like config values. |
| WireSockUI.Tests/Program.cs | Adds migration hardening tests (oversize + reparse-point), and updates editor validation tests to target the new validator. |
| README.md | Documents legacy migration limits and reparse-point rejection behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary:
Verification: