Repository navigation
fix(v3): start default signal handler during App.Run - #6098
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
WalkthroughThe application now starts the default desktop signal handler from ChangesSignal handling lifecycle
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant App
participant SignalHandler
participant OS
App->>App: Run completes startup
App->>SignalHandler: setupSignalHandler(options)
App->>SignalHandler: Start()
OS->>SignalHandler: SIGINT or SIGTERM
SignalHandler->>App: Quit()
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Default desktop SIGINT and SIGTERM handling now routes through application shutdown after startup, while disabled handling and mobile platform behavior remain preserved. The covered behavior is ready to merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the fix, motivation, issue number, tests, and known validation limits. However, it omits the required Type of change section, Test Configuration with wails doctor output or environment details, and the checklist responses.
✨ Finishing Touches📝 Generate docstrings
🧪 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. A rabbit reads each line, Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The desktop signal handler now starts on Android as well due to build constraints, which is likely unintended and should be guarded or split by platform.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes v3 apps bypassing App.Quit() on SIGINT/SIGTERM by starting the default signal handler during App.Run() (after successful startup), and adds regression tests that validate both enabled and disabled behavior.
Changes:
- Move default signal-handler setup from
New()toRun()after startup completes. - Start the default signal handler (
SignalHandler.Start()) when it is configured. - Add subprocess-based regression tests for SIGINT/SIGTERM (handler enabled vs disabled).
File summaries
| File | Description |
|---|---|
| v3/pkg/application/application.go | Moves signal-handler setup to App.Run() after successful startup. |
| v3/pkg/application/signal_handler_desktop.go | Starts the default signal handler when it is created. |
| v3/pkg/application/signal_handler_desktop_test.go | Adds subprocess regression tests for SIGINT/SIGTERM behavior with the handler enabled/disabled. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…t signal handler during App.Run
Description
SIGINT and SIGTERM previously terminated v3 desktop apps without calling
App.Quit(), so service shutdown and other cleanup hooks were skipped. Move signal-handler setup fromNew()toRun(), after successful startup, and start the handler there.DisableDefaultSignalHandlerremains respected, and both iOS and Android use no-op setup managed by their platform lifecycle.Adds subprocess regression tests for SIGINT and SIGTERM with the handler enabled and disabled. The tests verify dispatch to
App.Quit()and normal OS termination when disabled.Fixes #6096.
Validation
go test ./pkg/application ./internal/signal -count=1: passed on macOS arm64.Start()call removed and pass with it restored.go test -race ./pkg/application -run '^TestDefaultSignalHandler' -count=1: passed.ServiceShutdownandPostShutdownand exit successfully; disabling the handler preserves OS signal termination.GOOS=android GOARCH=arm64 CGO_ENABLED=0 go build ./pkg/application: passed.git diff --check: passed. CodeRabbit reviewed all three changed files with zero findings.The full server-mode application suite fails
TestSystemModesandTestIsPlatform, which assume desktop mode; both failures reproduce on the unchanged base. Windows and Linux runtime behavior was not exercised locally.Summary by CodeRabbit
Bug Fixes
Tests