Skip to content

Commit f89f735

Browse files
byapparovclaude
andcommitted
test: keep the legacy-todo tests independent of the todo table (#182 review 2)
The json-migration test no longer selects from the orphaned `todo` table; its stats assertions already show todo files are ignored. The --continue fixture writes a legacy todo row only while that table still exists, so both tests survive the schema reconciliation in #185. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d5257e9 commit f89f735

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/cli/test/cli/run-continue-legacy-todo.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ function addLegacyTodoHistory(database: string) {
5757
"INSERT INTO part (id, message_id, session_id, time_created, time_updated, data) VALUES (?, ?, ?, ?, ?, ?)",
5858
)
5959
.run("prt_zzzzlegacytodowrite", message.id, message.session_id, now, now, JSON.stringify(part))
60+
// Databases from versions with the todo tool also hold its rows, while the old
61+
// `todo` table still exists; reconciling the schema may drop it (#185).
62+
const todoTable = sqlite.query("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'todo'").get()
63+
if (!todoTable) return
6064
sqlite
6165
.query(
6266
"INSERT INTO todo (session_id, content, status, priority, position, time_created, time_updated) VALUES (?, ?, ?, ?, ?, ?, ?)",
6367
)
6468
.run(message.session_id, "Check the input", "completed", "high", 0, now, now)
65-
return message.session_id
6669
} finally {
6770
sqlite.close()
6871
}

0 commit comments

Comments
 (0)