From adb0e7c3b13df3c0b4d502b2dae3856dec33ced4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Mon, 5 Oct 2026 11:39:15 +0200 Subject: [PATCH] fix(demo): seal the Coach titles the way the app writes them A readable title is moved to title_encrypted by the boot backfill, and that update also sets updated_at to the moment it ran, so every seeded thread sorted under "Today" a minute after the restart. The seed now writes the ciphertext directly. --- scripts/seed-demo.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/seed-demo.ts b/scripts/seed-demo.ts index 95d198633..1097ed149 100644 --- a/scripts/seed-demo.ts +++ b/scripts/seed-demo.ts @@ -2227,10 +2227,20 @@ async function seed() { const lastAt = new Date( convo.startedAt.getTime() + (convo.turns.length - 1) * 60_000, ); + // The title is sealed the way the app writes it since v1.39.3. A + // readable `title` is picked up by the boot backfill, whose update + // also moves `updated_at` to the moment it ran, and every thread then + // sorted under "Today". await client.query( - `INSERT INTO coach_conversations (id, user_id, title, created_at, updated_at) + `INSERT INTO coach_conversations (id, user_id, title_encrypted, created_at, updated_at) VALUES ($1, $2, $3, $4, $5)`, - [convoId, userId, convo.title, convo.startedAt, lastAt], + [ + convoId, + userId, + Buffer.from(encryptToBytes(convo.title)), + convo.startedAt, + lastAt, + ], ); for (let t = 0; t < convo.turns.length; t++) { const turn = convo.turns[t];