From a5b9bf434fa0ac6eb88cea945d3c658975319f02 Mon Sep 17 00:00:00 2001 From: wtclaude Date: Wed, 30 Sep 2026 08:45:25 -0500 Subject: [PATCH] fix(rust): name the servers in a refused restore The walk read "is on rust-oxide"; it now reads the server's name. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY --- server/model/npcs/npcs.model.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/model/npcs/npcs.model.js b/server/model/npcs/npcs.model.js index 4bf4398..7d2e613 100644 --- a/server/model/npcs/npcs.model.js +++ b/server/model/npcs/npcs.model.js @@ -221,7 +221,9 @@ async function restore(id) { if (!existing.replaced) throw new NpcError('this profile is in use already') const clash = active(await db.listProfiles()).find((p) => p.name === existing.name && existing.servers.some((s) => covers(p, s))) if (clash) { - throw new NpcError(`the site's profile "${clash.name}" is on ${existing.servers.join(', ')}: change its servers or delete it first`, 409) + const names = new Map((await db.listNpcServers()).map((srv) => [srv.id, srv.name || srv.id])) + const where = existing.servers.map((id) => names.get(id) || id).join(', ') + throw new NpcError(`the site's profile "${clash.name}" is on ${where}: change its servers or delete it first`, 409) } await db.saveProfile({ ...existing, replaced: false }) await db.markDirty(existing.servers)