Fix installs stuck as "Uninstalling"; remove a failed install's record

An uninstall whose export failed was cancelled, but its install stayed
"uninstalling" for good. It now goes back to live (or waiting for the
proxy), like a failed or hand-cancelled uninstall.

Uninstall is refused for a failed install (nothing of it is on the
server, so the export always failed) and for one still installing. A
failed install's page offers "Remove the record" instead, which also
clears records already stuck from before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 08:44:17 +02:00
co-authored by Claude Opus 5.5
parent 20c7146b0c
commit 915ae82416
4 changed files with 103 additions and 6 deletions
+8 -1
View File
@@ -161,7 +161,14 @@ router.post('/deployments/link', wrap(async (req, res) => {
router.get('/deployments/:id', wrap(async (req, res) => {
const d = await prisma.deployment.findUnique({ where: { id: req.params.id }, include: { server: true, customer: { select: { id: true, name: true } }, install: true, jobs: { orderBy: { createdAt: 'desc' }, take: 50 }, exports: { select: { id: true, bytes: true, expiresAt: true, downloadedAt: true, deletedAt: true, createdAt: true } } } });
if (!d) throw bad('Not found.', 404);
res.json({ deployment: { ...d, server: serverSummary(d.server) }, fastPanel: await jobs.fastPanelText(d) });
res.json({ deployment: { ...d, server: serverSummary(d.server) }, fastPanel: await jobs.fastPanelText(d), canRemoveRecord: await jobs.neverInstalled(d) });
}));
// A failed install's record (nothing of it is on the server, so there's nothing to uninstall).
router.delete('/deployments/:id', wrap(async (req, res) => {
const d = await jobs.removeFailedInstall(req.params.id);
await audit(req, 'install_record_removed', d.id, { shortName: d.shortName, server: d.serverId, status: d.status });
res.json({ ok: true });
}));
router.post('/deployments/:id/proxy-done', wrap(async (req, res) => {