A character can't be given a name another character is "heard as" (#634) #1034
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/634-name-vs-alias-collision"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #634.
What was wrong
The collision check ran one way only. A new misspelling ("heard as") was refused when it was another character's name, but a new name was never checked against other characters' misspellings. So: list "Wyatt" as a misspelling of Idani, then create a character called Wyatt, and both were accepted.
The issue expected that state to rewrite every "Wyatt" in a transcript to "Idani". It does not:
vocabulary_service.build_alias_mapalready drops a misspelling that is somebody's name (covered bytest_name_snapping.py). What actually happened is quieter: Idani's "Wyatt" misspelling stopped being corrected, and nothing told the GM why.What changed
_reject_name_alias_collisionincampaign_character_service.py, called fromcreate_characterand fromupdate_characterwhen the name actually changes. Every path that names a character goes through those two:POST …/members/{user}/charactersPATCH …/characters/{id}PATCH /members/{user}withcharacter_name(the older route)Wording: "Wyatt is already listed as a misspelling of Idani's name in this campaign, so it cannot be another character's name."
Same comparison as the other direction (whitespace collapsed, case folded). A character's own misspellings don't count; another campaign's are never read. Import itself does what it does for the existing direction: nothing at import, the check runs when the member is assigned. The bot API creates no characters, so the contract version is untouched. No migration.
The issue's third question: campaigns already in that state
Nothing is done to them, and nothing needs to be: the misspelling is inert, no transcript was rewritten, and their characters can still be edited (the check runs only when a name changes). That is written on the function.
One thing to know
A player finishing Start a character with such a name gets the refusal and cannot fix the misspelling themself (the GM owns those). The message names whose misspelling it is, so they can pick another name or ask. It needs a GM to have listed a real name as a misspelling first, so it should be rare.
Checks
tests/test_name_snapping.py, one intests/sheets/test_sheets_creation.py): create, rename, case and whitespace, own misspelling allowed, another campaign allowed, the older member route, assigning an imported member, finishing a sheet. The existing direction's tests still pass.🤖 Generated with Claude Code
CI on
4b53faec, run https://git.rhoving.com/rbrooks/Quest-Board/actions/runs/1797 : three red jobs, none from this change (backend only).src/pages/discussions/Thread.test.jsx"keeps them marked after the thread is read again, which says nothing is new" could not find "Arrived while reading." A race in the page's refresh-on-focus hook, shown up by a busy runner; cause and fix in #1036.Not re-pushed: once the runner is healthy, those three jobs want a re-run. The shard can flake again until #1036 is on main.