8e045b0ac814357c3816908cb98900b89bff688d
name.reveal wrote the subject's actual name into the encountered row of every player who had met it: the SQL had no player predicate, so the leak was silent live and visible only after a restart. rewriteEncountered is now the one path that keeps a snapshot in step with its subject: it rewrites the SQLite row and the live in-memory entry together from the name rule, takes onlyPlayer for name.reveal (every player for reveal_all), and also runs on a rename, a link change and an owner change, so the wire and a post-restart reload cannot disagree (#30). The DB-only renameEncountered*/revealEncountered* helpers are gone, which is what let the two stores drift. token.update {character_id} now drops the token's own two names as part of the link patch (#29): a plain token can be linked, names supplied with a link stay invalid and unlinking still needs both names. Tests: tcharacters covers the per-player row, the DB/memory equality, the link handover; restart.test.mjs builds three named players, reveals to one of them and asserts the rows directly and the whole resync over SIGTERM/SIGKILL, plus a mid-session rename; leak.mjs/leakcheck.nim pit two players on the same subject and pin each entry's expected name (STALE_NAME). Mutations e1-e3 and the repointed b2 pin the three rules.
Description
No description provided
9.2 MiB
Languages
JavaScript
38.4%
Nim
38.3%
TypeScript
20.9%
Shell
1.9%
CSS
0.5%