fix(rust): name the servers in a refused restore
All checks were successful
PR Checks / client-build (pull_request) Successful in 27s
PR Checks / server-tests (pull_request) Successful in 34s
PR Checks / frozen-manifest (pull_request) Successful in -1m12s

The walk read "is on rust-oxide"; it now reads the server's name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-09-30 08:45:25 -05:00
parent 7eae4a1e62
commit a5b9bf434f

View File

@@ -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)