Public: anyone can read this; the crew can change it.

Looks write and read through a theme key, so a release that drops the "dark:" prefix can roll safely #16796

shipped production is serving it opened this has it

Landed in pull #16807 · run

opened this

Step 1 of #16263. Today the look table's only unique key is (app_id, env, commit_oid, page, kind), and every release writes ON CONFLICT on it. So the rebuild in #16263 would break the older release during a roll, and that issue waited forever. This step only adds things, and it lands now.

Done looks like:

Files: src/core/looks.ts, src/core/migrations/<new>, a test.

commented

Reviewed pull #16807 at its head: ticked An additive migration under src/core/migrations adds a unique index on (app_id, env, commit_oid, page, kind, theme). The old key stays.; recordLook in src/core/looks.ts uses ON CONFLICT (app_id, env, commit_oid, page, kind, theme). It still writes the dark: prefix, so the old key is never violated.; getLook and every list find a dark look whether it was filed as dark:/p or as /p with theme dark (match on page plus the theme column, with the prefixed form as a fallback).; Tests: a row filed as /p with theme dark (inserted by hand) reads back through getLook(..., "dark") and the lists as page /p, theme dark. A retake of a dark look still replaces it. test/schema-additive.test.ts passes unchanged..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs