fix(dev): stop watcher when primary process exits - #6049
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughChangesWatcher shutdown supervision
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to The change improves Ctrl+C cleanup for standard development configurations, but an accepted list-form configuration can still leave the watcher or background processes running after the primary process exits. The PR is mergeable with explicit owner awareness and follow-up to apply the shutdown default consistently across both configuration forms. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Watcher as wails3 dev watcher
participant Refresh as refresh engine
participant Primary as primary process
participant Background as background processes
Watcher->>Primary: apply shutdown exit policy
Watcher->>Refresh: start engine
Primary-->>Refresh: report interrupt exit
Refresh->>Background: stop background processes
Refresh-->>Watcher: return interrupt error
Watcher->>Watcher: log graceful shutdown and return nil
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes address issue Full details: Out of Scope Changes checkExplanation All reviewed changes support the linked issue. The changelog entry, dependency update, generated configuration, watcher changes, platform-specific interrupt handling, and tests are directly related to terminating the complete development session after Ctrl+C. Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 7 files. (3 skipped: 3 unsupported.) Full details: Description checkExplanation The description is complete and follows the template. It explains the fix, links issue
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Fix
wails3 devremaining alive after Ctrl+C terminates the primary application but does not deliver SIGINT to the watcher process group.This change upgrades
github.com/atterpac/refreshfrom v1.0.0 to v1.1.3 and defaults primary development processes to itsshutdownexit policy. Explicit user-configured exit policies are preserved. It also removes the redundant Wails signal wait after the refresh supervisor returns, so the watcher exits together with its managed background processes.When the primary process receives SIGINT directly, refresh reports the resulting process exit as an error. Wails now identifies that exit using structured platform process state and reports it as the same graceful interrupt used when the watcher receives SIGINT itself. Other signals and non-zero exits remain errors. Unix SIGINT and Windows
STATUS_CONTROL_C_EXITare handled separately.Newly generated project configurations include
exit_policy: shutdown. Existing configurations receive the same default at runtime, so no migration is required.Fixes #6048
Type of change
How Has This Been Tested?
Recording.2026-08-28.at.17-10-04.mp4
Runtime reproduction was performed on macOS using the repository and revision from #6048:
After the native application and Vite started, pressing Ctrl+C once:
WRN graceful exit requested signal=interrupt;Additional verification:
The Windows command package and platform-specific test compile successfully, but the runtime behavior has not been tested on Windows. Linux has not been tested.
Test Configuration
Checklist:
website/src/pages/changelog.mdxwith details of this PR (not applicable: this is a v3 change)Summary by CodeRabbit
wails3 devand its background processes now shut down automatically when the main application exits.