fix(chat): migrate legacy character cache identities

This commit is contained in:
2026-07-20 17:44:22 +08:00
parent 10132652c7
commit 159e8bfd59
6 changed files with 435 additions and 8 deletions
@@ -0,0 +1,14 @@
const LEGACY_CHARACTER_ID_ALIASES: Readonly<Record<string, string>> =
Object.freeze({
character_elio: "elio",
character_maya: "maya-tan",
character_nayeli: "nayeli-cervantes",
});
/**
* Converts character IDs persisted by pre-catalog releases to the current
* backend IDs. Unknown and already-current IDs pass through unchanged.
*/
export function normalizeLegacyCharacterId(characterId: string): string {
return LEGACY_CHARACTER_ID_ALIASES[characterId] ?? characterId;
}