fix(service): propagate native uninstall failures - #1351
Conversation
📝 WalkthroughWalkthroughThe uninstall flow now accepts injectable test hooks. Native WinSW removal errors propagate, scheduler cleanup runs first, and install state remains when native removal fails. Tests reset hooks and cover this behavior. ChangesUninstall lifecycle
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
2/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/service.ts`:
- Around line 2487-2490: Update the scheduler-removal flow around the
queryWindowsTask and uninstallWindowsTask hooks so the catch only handles a
confirmed absent task; do not swallow uninstallWindowsTask failures, and
propagate them before removeInstallState can run. Preserve successful removal
and explicitly already-absent behavior, then add a regression test verifying
removeInstallState is not called when uninstallWindowsTask throws.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f03f94b5-d154-4cfb-bfac-85e0a67f9d4b
📒 Files selected for processing (2)
src/service.tstests/uninstall.test.ts
|
Please rebase this PR onto the latest |
Summary
The previous Windows path could swallow scheduler or native removal errors and delete install state while a service backend remained installed.
Verification
bun run typecheck— passed.bun run privacy:scan— passed.git diff --check origin/dev...HEAD— passed.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit