feat(FN-5413): add null description persist regression test

Added a regression test for null description persistence in the core task store and a CLI patch changeset to ship the fix.

Fusion-Task-Id: FN-5413
This commit is contained in:
Fusion (runfusion.ai)
2026-05-21 08:19:57 -07:00
committed by gsxdsm
parent f236dc3982
commit a04ba3cf21
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Coerce null or undefined `task.description` values to an empty string when persisting TaskStore rows.

View File

@@ -35,6 +35,27 @@ describe("TaskStore", () => {
const createSourceIssueFixture = () => harness.createSourceIssueFixture();
const insertLogEntryWithTimestamp = (...args: any[]) => (harness as any).insertLogEntryWithTimestamp(...args);
describe("FN-5413 null description coercion", () => {
it.each([
["undefined", undefined],
["null", null],
])("coerces %s description to empty string on persist", async (_label, description) => {
const created = await store.createTask({
description: "Initial description",
});
const task = await store.getTask(created.id);
(task as Task & { description?: string | null }).description = description;
expect(() => {
(store as unknown as { upsertTaskWithFtsRecovery: (task: Task) => void }).upsertTaskWithFtsRecovery(task);
}).not.toThrow();
const persisted = await store.getTask(created.id);
expect(persisted.description).toBe("");
});
});
describe("breakIntoSubtasks task creation flag", () => {
it("persists breakIntoSubtasks=true when explicitly requested", async () => {
const task = await store.createTask({