The canvas tracer's cleanup puts the admin's row back as it found it #226
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/Ponente!226
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "trace-unseed-restores-admin"
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?
design/trace/seed.pydraws the admin as initials by overwriting their member row (DisplayName→ plaintext'Grandiras',AvatarUrl→ null,UsesLocalProfile→ true), andunseed.sqlonly resetUsesLocalProfileto false. After a trace the row kept the seeded name and no picture until some profile refresh overwrote them, and a member who really was on a local profile would have been switched off it.The fix follows the pattern seed.py already uses for the default board's grants (
zz_canvas_saved):seed.pysavesDid,DisplayName,AvatarUrlandUsesLocalProfileintozz_canvas_adminbefore it overwrites them. It usescreate table if not exists, so a second seed without an unseed in between keeps the real row and doesn't save the demo one.unseed.sqlrestores the three columns from that table and drops it. This replaces the loneUsesLocalProfile = false.The saved copy is the stored ciphertext (
enc:v1:…), and that's what goes back into the column: the value converter decrypts it on read.Verified against the test stack by running README steps 2 and 5 (seed, restart the app, unseed, restart the app) and comparing snapshots of the admin row:
DisplayNameAvatarUrlUsesLocalProfileenc:v1:IpSCMs…pg==enc:v1:qyq7V/…KRI=enc:v1:2F09xP…6w==(the migrator sealed'Grandiras')cmp)cmp)The member, board and grant counts and the default board's visibility also came back unchanged, and no
zz_tables were left. No canvas retrace is needed. There's no changelog entry because only a maintainer would notice this.🤖 Generated with Claude Code
1b7bfe954ba4dde34f87🤖 Reviewing this PR — the review will link the full session transcript.
✅ Verdict: approve — no blocking issues found.
Clean fix that mirrors the existing
zz_canvas_savedpattern. Thecreate table if not exists … as selectcorrectly preserves the real admin row across a re-seed without an intervening unseed, and restoring the stored ciphertext is right:Members.DisplayNameandMembers.AvatarUrlare both in theEncryptionMigratorallowlist (idempotent on theenc:v1:prefix), and the value converter decrypts on read. TheUPDATE … FROMjoin touches at most the one admin row, and since unseed.sql already requires a prior seed (it readszz_canvas_saved), the new table dependency adds no new precondition. Verified against the test stack per the description; no changelog entry is reasonable for maintainer-only tooling.⏱ 1m 35s · 0 steps · $0.0000 · tokens: 0 in / 0 out (+0 cache-read) · Go: 5h 11% · wk 78% · mo 72%