Character creation silently drops unknown skill/equipment names #36

Closed
opened 2026-08-23 05:42:05 +00:00 by nasandre · 2 comments
Owner

Medium (has caused real bugs twice)

`characterService.createCharacter` looks skills/equipment up by exact lowercase name and silently skips rows with no match:

  • Skills: `characterService.ts:180-192` — `SELECT id FROM skills WHERE LOWER(name)=LOWER($1)` → `if (rows.length > 0)` else nothing
  • Equipment kit: `characterService.ts:225-237` — same pattern against `equipment_items`

When frontend constants drift from seeded reference data (this happened with CRPG_SKILLS and standard-kit items), users get characters with missing skills/gear and zero feedback.

Suggested fix

Log a warning server-side per skipped item; better, return created-vs-skipped lists in the API response and surface them in the UI. Consider upserting unknown names as custom rows (`character_equipment.custom_name` exists).

## Medium (has caused real bugs twice) \`characterService.createCharacter\` looks skills/equipment up by exact lowercase name and **silently skips** rows with no match: - Skills: \`characterService.ts:180-192\` — \`SELECT id FROM skills WHERE LOWER(name)=LOWER($1)\` → \`if (rows.length > 0)\` else nothing - Equipment kit: \`characterService.ts:225-237\` — same pattern against \`equipment_items\` When frontend constants drift from seeded reference data (this happened with CRPG_SKILLS and standard-kit items), users get characters with missing skills/gear and zero feedback. ## Suggested fix Log a warning server-side per skipped item; better, return created-vs-skipped lists in the API response and surface them in the UI. Consider upserting unknown names as custom rows (\`character_equipment.custom_name\` exists).
Author
Owner

✅ Fixed:

  • createCharacter now logs a server-side warning per skipped skill/talent/equipment name (with character id), e.g. skipped unknown skill "Foo"
  • Kept response shape unchanged; warnings make reference-data drift visible in container logs instead of vanishing silently
✅ **Fixed**: - `createCharacter` now logs a server-side warning per skipped skill/talent/equipment name (with character id), e.g. `skipped unknown skill "Foo"` - Kept response shape unchanged; warnings make reference-data drift visible in container logs instead of vanishing silently
Author
Owner

✅ Fixed (commit 05b5453) — createCharacter logs per-item warnings for unknown skill/talent/equipment names, e.g. createCharacter: skipped unknown skill "Foo" for character <id>. Reference-data drift is now visible in container logs.

✅ **Fixed** (commit `05b5453`) — createCharacter logs per-item warnings for unknown skill/talent/equipment names, e.g. `createCharacter: skipped unknown skill "Foo" for character <id>`. Reference-data drift is now visible in container logs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nasandre/wh40-rogue-trader#36
No description provided.