Fix updater restart inside Windows launcher jobs#5778
Conversation
Create the updater helper with CREATE_BREAKAWAY_FROM_JOB and wait for an explicit helper readiness signal before quitting the host application. This keeps the current process alive when breakaway or helper startup fails.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
WalkthroughThe updater now uses a readiness file to coordinate helper startup, reports helper initialization failures, delays application exit until readiness succeeds, and adds platform-specific spawn error handling including Windows Job breakaway support. ChangesHelper readiness and restart coordination
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Updater.Restart
participant HelperProcess
participant ReadyFile
participant Host.Quit
Updater.Restart->>HelperProcess: spawn with readiness path
HelperProcess->>ReadyFile: write ready or error
Updater.Restart->>ReadyFile: wait for readiness
ReadyFile-->>Updater.Restart: status
Updater.Restart->>Host.Quit: quit after ready
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies" 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 |
Summary
CREATE_BREAKAWAY_FROM_JOBso kill-on-close launcher Jobs do not terminate it with the host appHost.Quit, keeping the current process alive when helper startup failsTest plan
go test ./pkg/updateron WindowsRestartdoes not callHost.Quitbefore helper readiness🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Platform Improvements