fix(server): retain the runtime used by the service launcher#23247

draft3
main
fix/issue-17490
opened4d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 2d ago
1 unresolved thread · Jump to file
Selected thread: apps/server/src/serviceLauncher.ts:563 — 🟠 **High** `src/serviceLauncher.ts:563` A concurrent successful `install({ start: false })` can have its new `launcherVersion` overwritten with the old value, leaving service state pointing at launcher A and allowing pruning to remove launcher B even though the unit was repointed to B. `#writeState` reads the state before the installer writes B, then atomically writes its stale merged state afterward; coordinate this merge and write with the install/repoint operation so the installed version is preserved. <details> <summary>🚀 Reply "<strong>fix it for me</strong>" or copy this <strong>AI Prompt</strong> for your agent:</summary> ```text In file @apps/server/src/serviceLauncher.ts around line 563: A concurrent successful `install({ start: false })` can have its new `launcherVersion` overwritten with the old value, leaving service state pointing at launcher A and allowing pruning to remove launcher B even though the unit was repointed to B. `#writeState` reads the state before the installer writes B, then atomically writes its stale merged state afterward; coordinate this merge and write with the install/repoint operation so the installed version is preserved. ``` </details> <!-- macroscope-meta: {"kind":"code_review","variant":"dbca4b5e98da5ade3401563e99690a04"} -->
0 / 7 viewed7 files changedLine totals unavailable