Repository navigation
Refuse a daemon rename onto an installed service - #1268
Conversation
A stopped service has no socket, so only its unit shows the name is taken; the rename now checks it under the target lock before retiring the old service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoRefuse daemon renames when the target service is installed
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
| /// or its state is unknown. Nothing is written for the new id — its own | ||
| /// entry-time leftover-marker recovery already ran, as on every install. The old unit is untouched | ||
| /// unless the new id was taken while it was being retired. The stderr line |
There was a problem hiding this comment.
2. Late refusal docs hide a saved marker 📘 Rule violation ⚙ Maintainability
The expanded RetireRefused documentation says nothing is written for the new id, but the new target_claimed branch returns after InstallVerifiedAsync writes a captured transaction marker for that id. When another unit claims the target during retirement, a later reader could mistake the refusal for one that leaves no target-side transaction state.
Agent Prompt
## Issue description
The refusal documentation now covers `target_claimed`, but its claim that nothing is written for the new id is inaccurate for that path.
## Fix Focus Areas
- src/Capacitor.Cli/Services/ServiceVerify.cs[73-78]
- src/Capacitor.Cli/Services/ServiceVerify.cs[839-843]
- src/Capacitor.Cli/Services/ServiceVerify.cs[1094-1097]
## Recommended Fix
Distinguish the early refusals from `target_claimed`: no new unit is written, but the late refusal can leave a captured transaction marker for recovery.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit e15473c |
AI-2703 (Linear-only; there is no GitHub issue)
What & why
Settings probes only the target name's socket, so a stopped-but-installed service under the new name looked free, and
install --replace --retirethen cleared that unit — possibly another profile's background service — after retiring the old one. Under the target's transaction lock, before the old service is touched, the rename now queries the target: an installed unit (loaded or stopped) refuses withretire_reason=target_occupied, an unknown state withtarget_unknown(exit 30). A live owner staysverify_contended. The app restores the saved name on those two reasons and says nothing changed.Where to look
A unit that appears under the new name while the old one is being retired (a writer ignoring the lock) is refused as
target_claimedrather than cleared; the old service is already retired by then, so the app keeps its existing attention message with the uninstall hint.Verification
ServiceVerify suites pass (112), including new cases for a stopped target, an unknown target and a target claimed mid-retire; each new case failed before the change. A free target still renames. SettingsViewModel tests (39) cover the restored name and message for both refusal reasons.
🤖 Generated with Claude Code